Beispiel #1
0
        static GacInfo()
        {
            GacPaths = new string[] {
                Fusion.GetGacPath(false),
                Fusion.GetGacPath(true)
            };

            var newOtherGacPaths = new List <string>();
            var newWinmdPaths    = new List <string>();

            var windir = Environment.GetEnvironmentVariable("WINDIR");

            if (!string.IsNullOrEmpty(windir))
            {
                AddIfExists(newOtherGacPaths, windir, @"Microsoft.NET\Framework\v1.1.4322");
                AddIfExists(newOtherGacPaths, windir, @"Microsoft.NET\Framework\v1.0.3705");
            }

            var dirPF = Environment.GetEnvironmentVariable("ProgramFiles");

            AddWinMDPaths(newWinmdPaths, dirPF);
            var dirPFx86 = Environment.GetEnvironmentVariable("ProgramFiles(x86)");

            if (!StringComparer.OrdinalIgnoreCase.Equals(dirPF, dirPFx86))
            {
                AddWinMDPaths(newWinmdPaths, dirPFx86);
            }
            AddIfExists(newWinmdPaths, Environment.SystemDirectory, "WinMetadata");

            OtherGacPaths = newOtherGacPaths.ToArray();
            WinmdPaths    = newWinmdPaths.ToArray();
        }