Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit a9cd318

Browse files
committed
Add fallback to using path to v4 GAC assemblies
1 parent 65a5400 commit a9cd318

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ServiceStack.Text/Env.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ public static string ReferenceAssembyPath
9898
else
9999
{
100100
var v4Dirs = PclExport.Instance.GetDirectoryNames(netFxReferenceBasePath, "v4*");
101+
if (v4Dirs.Length == 0)
102+
{
103+
var winPath = PclExport.Instance.GetEnvironmentVariable("SYSTEMROOT") ?? @"C:\Windows";
104+
var gacPath = winPath + @"\Microsoft.NET\Framework\";
105+
v4Dirs = PclExport.Instance.GetDirectoryNames(gacPath, "v4*");
106+
}
101107
if (v4Dirs.Length > 0)
102108
{
103109
referenceAssembyPath = v4Dirs[v4Dirs.Length - 1]; //latest v4

0 commit comments

Comments
 (0)