ApiExamples.ApiExampleBase.GetAssemblyDir C# (CSharp) Method

GetAssemblyDir() private static method

Returns the assembly directory correctly even if the assembly is shadow-copied.
private static GetAssemblyDir ( Assembly assembly ) : string
assembly System.Reflection.Assembly
return string
        private static string GetAssemblyDir(Assembly assembly)
        {
            // CodeBase is a full URI, such as file:///x:\blahblah.
            Uri uri = new Uri(assembly.CodeBase);
            return Path.GetDirectoryName(uri.LocalPath) + Path.DirectorySeparatorChar;
        }