From 83aa804b22db8e0ca312e1712516fdfd9b03d87f Mon Sep 17 00:00:00 2001 From: yangzhongke Date: Fri, 18 Mar 2022 12:25:55 +0800 Subject: [PATCH] remove asmresolver.dotnet --- Zack.DotNetTrimmer/Properties/launchSettings.json | 2 +- Zack.DotNetTrimmer/Zack.DotNetTrimmer.csproj | 2 +- Zack.DotNetTrimmerLib/PEHelpers.cs | 6 ++++-- Zack.DotNetTrimmerLib/Zack.DotNetTrimmerLib.csproj | 1 - 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Zack.DotNetTrimmer/Properties/launchSettings.json b/Zack.DotNetTrimmer/Properties/launchSettings.json index 54c7e8c..ab88b6c 100644 --- a/Zack.DotNetTrimmer/Properties/launchSettings.json +++ b/Zack.DotNetTrimmer/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "配置文件 1": { "commandName": "Project", - "commandLineArgs": "--file \"E:\\主同步盘\\我的坚果云\\MyCode\\DOTNET\\Zack.DotNetTrimmer\\ProjectsForTest\\WinForm.NET5TeeChart-NET-Pro-Samples\\bin\\publish\\TeeChart Examples.exe\" --urls=http://localhost:5000/" + "commandLineArgs": " --record 1.json --file E:\\temp\\winformFX1\\winformFX1\\bin\\Debug\\winformFX1.exe" } } } \ No newline at end of file diff --git a/Zack.DotNetTrimmer/Zack.DotNetTrimmer.csproj b/Zack.DotNetTrimmer/Zack.DotNetTrimmer.csproj index eb832f6..1c4707a 100644 --- a/Zack.DotNetTrimmer/Zack.DotNetTrimmer.csproj +++ b/Zack.DotNetTrimmer/Zack.DotNetTrimmer.csproj @@ -6,7 +6,7 @@ enable enable - 2.0.0.1 + 2.0.0.2 diff --git a/Zack.DotNetTrimmerLib/PEHelpers.cs b/Zack.DotNetTrimmerLib/PEHelpers.cs index a598d76..63ef14f 100644 --- a/Zack.DotNetTrimmerLib/PEHelpers.cs +++ b/Zack.DotNetTrimmerLib/PEHelpers.cs @@ -41,8 +41,10 @@ public static bool IsNetFrameworkApp(string startupFile) { return false; } - var moduleDef = AsmResolver.DotNet.ModuleDefinition.FromFile(startupFile); - return moduleDef.OriginalTargetRuntime.Name == ".NETFramework"; + using (var module = ModuleDefMD.Load(startupFile)) + { + return module.RuntimeVersion.StartsWith("v4."); + } } public static bool IsSelfContainedApp(string startupFile) diff --git a/Zack.DotNetTrimmerLib/Zack.DotNetTrimmerLib.csproj b/Zack.DotNetTrimmerLib/Zack.DotNetTrimmerLib.csproj index aab42e9..74f8fad 100644 --- a/Zack.DotNetTrimmerLib/Zack.DotNetTrimmerLib.csproj +++ b/Zack.DotNetTrimmerLib/Zack.DotNetTrimmerLib.csproj @@ -7,7 +7,6 @@ enable -