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

GetCurrentMonoGac() static private method

static private GetCurrentMonoGac ( ) : string
return string
        static string GetCurrentMonoGac()
        {
            return Path.Combine (
                Directory.GetParent (
            #if !NET_CORE
                    Path.GetDirectoryName (typeof (object).Module.FullyQualifiedName)).FullName,
            #else
                    Path.GetDirectoryName (typeof (object).GetTypeInfo().Module.FullyQualifiedName)).FullName,
            #endif
                "gac");
        }

Usage Example

Esempio n. 1
0
        private static Collection <string> GetDefaultMonoGacPaths()
        {
            Collection <string> strs = new Collection <string>(1);
            string currentMonoGac    = BaseAssemblyResolver.GetCurrentMonoGac();

            if (currentMonoGac != null)
            {
                strs.Add(currentMonoGac);
            }
            string environmentVariable = Environment.GetEnvironmentVariable("MONO_GAC_PREFIX");

            if (string.IsNullOrEmpty(environmentVariable))
            {
                return(strs);
            }
            string[] strArrays = environmentVariable.Split(new char[] { Path.PathSeparator });
            for (int i = 0; i < (int)strArrays.Length; i++)
            {
                string str = strArrays[i];
                if (!string.IsNullOrEmpty(str))
                {
                    string str1 = Path.Combine(Path.Combine(Path.Combine(str, "lib"), "mono"), "gac");
                    if (Directory.Exists(str1) && !strs.Contains(currentMonoGac))
                    {
                        strs.Add(str1);
                    }
                }
            }
            return(strs);
        }