Mono.Cecil.BaseAssemblyResolver.GetDefaultMonoGacPaths C# (CSharp) Method

GetDefaultMonoGacPaths() static private method

static private GetDefaultMonoGacPaths ( ) : Collection
return Collection
        static Collection<string> GetDefaultMonoGacPaths()
        {
            var paths = new Collection<string> (1);
            var gac = GetCurrentMonoGac ();
            if (gac != null)
                paths.Add (gac);

            var gac_paths_env = Environment.GetEnvironmentVariable ("MONO_GAC_PREFIX");
            if (string.IsNullOrEmpty (gac_paths_env))
                return paths;

            var prefixes = gac_paths_env.Split (Path.PathSeparator);
            foreach (var prefix in prefixes) {
                if (string.IsNullOrEmpty (prefix))
                    continue;

                var gac_path = Path.Combine (Path.Combine (Path.Combine (prefix, "lib"), "mono"), "gac");
                if (Directory.Exists (gac_path) && !paths.Contains (gac))
                    paths.Add (gac_path);
            }

            return paths;
        }

Usage Example

Esempio n. 1
0
        private static Collection <string> GetGacPaths()
        {
            if (BaseAssemblyResolver.on_mono)
            {
                return(BaseAssemblyResolver.GetDefaultMonoGacPaths());
            }
            Collection <string> strs   = new Collection <string>(2);
            string environmentVariable = Environment.GetEnvironmentVariable("WINDIR");

            if (environmentVariable == null)
            {
                return(strs);
            }
            strs.Add(Path.Combine(environmentVariable, "assembly"));
            strs.Add(Path.Combine(environmentVariable, Path.Combine("Microsoft.NET", "assembly")));
            return(strs);
        }