|
|
|
@ -38,7 +38,7 @@ namespace ICSharpCode.ILSpy.AddIn
@@ -38,7 +38,7 @@ namespace ICSharpCode.ILSpy.AddIn
|
|
|
|
|
|
|
|
|
|
static readonly string DetectTargetFrameworkIdRefPathPattern = |
|
|
|
|
@"(Reference Assemblies[/\\]Microsoft[/\\]Framework[/\\](?<1>.NETFramework)[/\\]v(?<2>[^/\\]+)[/\\])" + |
|
|
|
|
@"|(NuGetFallbackFolder[/\\](?<1>[^/\\]+)\\(?<2>[^/\\]+)([/\\].*)?[/\\]ref[/\\])"; |
|
|
|
|
@"|((NuGetFallbackFolder|packs)[/\\](?<1>[^/\\]+)\\(?<2>[^/\\]+)([/\\].*)?[/\\]ref[/\\])"; |
|
|
|
|
|
|
|
|
|
public static string DetectTargetFrameworkId(AssemblyDefinition assembly, string assemblyPath = null) |
|
|
|
|
{ |
|
|
|
@ -63,6 +63,7 @@ namespace ICSharpCode.ILSpy.AddIn
@@ -63,6 +63,7 @@ namespace ICSharpCode.ILSpy.AddIn
|
|
|
|
|
* |
|
|
|
|
* - .NETFramework -> C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\mscorlib.dll |
|
|
|
|
* - .NETCore -> C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.1.0\ref\netcoreapp2.1\System.Console.dll |
|
|
|
|
* -> C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.0.0\ref\netcoreapp3.0\System.Runtime.Extensions.dll |
|
|
|
|
* - .NETStandard -> C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\ref\netstandard.dll |
|
|
|
|
*/ |
|
|
|
|
var pathMatch = Regex.Match(assemblyPath, DetectTargetFrameworkIdRefPathPattern, |
|
|
|
@ -73,9 +74,9 @@ namespace ICSharpCode.ILSpy.AddIn
@@ -73,9 +74,9 @@ namespace ICSharpCode.ILSpy.AddIn
|
|
|
|
|
|
|
|
|
|
if (type == ".NETFramework") { |
|
|
|
|
return $".NETFramework,Version=v{version}"; |
|
|
|
|
} else if (type.Contains("netcore")) { |
|
|
|
|
} else if (type.ToLower().Contains("netcore")) { |
|
|
|
|
return $".NETCoreApp,Version=v{version}"; |
|
|
|
|
} else if (type.Contains("netstandard")) { |
|
|
|
|
} else if (type.ToLower().Contains("netstandard")) { |
|
|
|
|
return $".NETStandard,Version=v{version}"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|