|
|
|
@ -20,17 +20,33 @@ namespace ICSharpCode.SharpDevelop.Dom
@@ -20,17 +20,33 @@ namespace ICSharpCode.SharpDevelop.Dom
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class GacInterop |
|
|
|
|
{ |
|
|
|
|
static string cachedGacPath; |
|
|
|
|
volatile static string cachedGacPathV2; |
|
|
|
|
volatile static string cachedGacPathV4; |
|
|
|
|
|
|
|
|
|
public static string GacRootPath { |
|
|
|
|
public static string GacRootPathV2 { |
|
|
|
|
get { |
|
|
|
|
if (cachedGacPath == null) { |
|
|
|
|
cachedGacPath = Fusion.GetGacPath(); |
|
|
|
|
if (cachedGacPathV2 == null) { |
|
|
|
|
cachedGacPathV2 = Fusion.GetGacPath(false); |
|
|
|
|
} |
|
|
|
|
return cachedGacPath; |
|
|
|
|
return cachedGacPathV2; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static string GacRootPathV4 { |
|
|
|
|
get { |
|
|
|
|
if (cachedGacPathV4 == null) { |
|
|
|
|
cachedGacPathV4 = Fusion.GetGacPath(true); |
|
|
|
|
} |
|
|
|
|
return cachedGacPathV4; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static bool IsWithinGac(string assemblyLocation) |
|
|
|
|
{ |
|
|
|
|
return Core.FileUtility.IsBaseDirectory(GacRootPathV2, assemblyLocation) |
|
|
|
|
|| Core.FileUtility.IsBaseDirectory(GacRootPathV4, assemblyLocation); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static List<DomAssemblyName> GetAssemblyList() |
|
|
|
|
{ |
|
|
|
|
IApplicationContext applicationContext = null; |
|
|
|
|