Dotfuscator
到目前为止一直运行良好。我不知道为什么。
我的项目类型是aspnetcore 3.0。使用以下命令发布:
dotnet publish --self-contained -c Release -r linux-x64
错误输出为:
[Build Output] Renaming...
[Build Output]
[Build Output] Updating Markup...
[Build Output]
[Build Output] Writing map file to C:\code\quant\Dotfuscated\Map_win.xml
[Build Output]
[Smart Obfuscation] User Type QuantWS.Startup was excluded from renaming by AspNetStartupRule for the following reasons: Type is an ASP.NET Core Startup Type.
[Build Output] Writing Assemblies...
[Build Output]
[Build Output] Couldn't load external type because its assembly can't be found: Microsoft.AspNetCore.Hosting.IWebHostBuilder,Microsoft.AspNetCore.Hosting.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
=== Pre-bind state information ===
C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\QuantWS.dll
LOG: DisplayName = Microsoft.AspNetCore.Hosting.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
LOG: Appbase = C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64
LOG: Processing DEVPATH.
LOG: DEVPATH not enabled. Falling through to regular bind.
LOG: Checking Cache
LOG: Assembly not found in cache.
LOG: Codebase not set.
LOG: Processing CodeBase
LOG: Checking Windows Kit Folder : C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral
LOG: Probing C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\Microsoft.AspNetCore.Hosting.Abstractions\3.0.0.0\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\Microsoft.AspNetCore.Hosting.Abstractions\3.0.0.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd LOG: Not found in Windows Kit Folder.
LOG: Checking Windows Kit Folder : C:\Program Files (x86)\Windows Kits\10\References
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\Microsoft.AspNetCore.Hosting.Abstractions\3.0.0.0\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\Microsoft.AspNetCore.Hosting.Abstractions\3.0.0.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Checking Windows Kit Folder : C:\Program Files (x86)\Windows Kits\10\References\10.0.17134.0
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.17134.0\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.17134.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.17134.0\Microsoft.AspNetCore.Hosting.Abstractions\3.0.0.0\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.17134.0\Microsoft.AspNetCore.Hosting.Abstractions\3.0.0.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Checking Windows Kit Folder : C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Microsoft.AspNetCore.Hosting.Abstractions\3.0.0.0\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Microsoft.AspNetCore.Hosting.Abstractions\3.0.0.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Checking Windows Kit Folder : C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0\Microsoft.AspNetCore.Hosting.Abstractions\3.0.0.0\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0\Microsoft.AspNetCore.Hosting.Abstractions\3.0.0.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Not found in Windows Kit Folder.
LOG: Checking AssemblyFoldersEx paths for runtime version v4.0.30319.
LOG: Probing C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.9\bin\plugins\Diagnostics\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.9\bin\plugins\Diagnostics\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Not Found in AssemblyFoldersEx paths.
LOG: Checking AssemblyFolders paths.
LOG: Probing C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Program Files\IIS\Microsoft Web Deploy V3\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Program Files\IIS\Microsoft Web Deploy V3\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Not Found in AssemblyFolders paths.
LOG: Checking Visual Studio AssemblyFolders paths.
LOG: Not Found in Visual Studio AssemblyFolders paths.
LOG: Looking in GAC
LOG: Assembly not found in GAC
LOG: Probing AppBase
LOG: Probing C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\Microsoft.AspNetCore.Hosting.Abstractions.dll.deploy
LOG: Probing C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.dll.deploy
LOG: Probing C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\Microsoft.AspNetCore.Hosting.Abstractions.exe
LOG: Probing C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.exe
LOG: Probing C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\Microsoft.AspNetCore.Hosting.Abstractions.exe.deploy
LOG: Probing C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.exe.deploy
LOG: Probing Private Bin Path
LOG: Bin Path not set
LOG: Processing User Defined Assembly Load Path.
LOG: The User Defined Assembly Load Path is not set.
LOG: Checking Reference Assemblies folders.
LOG: Not found in Reference Assemblies folders.
LOG: Checking NuGet Folder : C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.hosting.abstractions\2.1.1\lib\netstandard2.0
LOG: Probing C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.hosting.abstractions\2.1.1\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.hosting.abstractions\2.1.1\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Probing C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.hosting.abstractions\2.1.1\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Checking NuGet Folder : C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.hosting.abstractions\2.2.0\lib\netstandard2.0
LOG: Probing C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.hosting.abstractions\2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.hosting.abstractions\2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Probing C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.hosting.abstractions\2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Checking NuGet Folder : C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.app.runtime.linux-x64\3.0.0-preview7.19365.7\runtimes\linux-x64\lib\netcoreapp3.0
LOG: Probing C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.app.runtime.linux-x64\3.0.0-preview7.19365.7\runtimes\linux-x64\lib\netcoreapp3.0\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.app.runtime.linux-x64\3.0.0-preview7.19365.7\runtimes\linux-x64\lib\netcoreapp3.0\Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Probing C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.app.runtime.linux-x64\3.0.0-preview7.19365.7\runtimes\linux-x64\lib\netcoreapp3.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.ni.dll LOG: Checking NuGet Folder : C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.hosting.abstractions\2.0.0\lib\netstandard2.0
LOG: Probing C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.hosting.abstractions\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.hosting.abstractions\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Probing C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.hosting.abstractions\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Checking NuGet Folder : C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.hosting.abstractions\2.1.1\lib\netstandard2.0
LOG: Probing C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.hosting.abstractions\2.1.1\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.hosting.abstractions\2.1.1\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Probing C:\Users\EDZ\.nuget\packages\microsoft.aspnetcore.hosting.abstractions\2.1.1\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Not found in NuGet folders.
LOG: Checking additional folder : C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64
LOG: Probing C:\code\quant\QuantWS\bin\Release\netcoreapp3.0\linux-x64\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Checking additional folder : C:\Users\EDZ\AppData\Local\Temp\~QuantWS.8
LOG: Probing C:\Users\EDZ\AppData\Local\Temp\~QuantWS.8\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:\Users\EDZ\AppData\Local\Temp\~QuantWS.8\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Not found in additional folders.
LOG: Loose binding enabled. Probing for later versions.
当我在Visual Studio中查找IWebHostBuilder
时,它位于
C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.0.0-preview7.19365.7\ref\netcoreapp3.0\Microsoft.AspNetCore.Hosting.Abstractions.dll
。同一文件也位于publish输出目录中。但是Dotfuscator不能接受它们并说Strong name match failed
。
直到今天还可以。如果我将项目降级为aspnetcore 2.2,问题将消失。有人可以帮忙吗?
答案 0 :(得分:2)
注意:我是作为Dotfuscator开发人员的专业人士来回答的。
Dotfuscator自动尝试将引用程序集定位在它所知道的位置,但是Microsoft最近添加了一些新程序(.NETCore 3.0毕竟是预览!)。将来的社区更新将添加该新位置,该位置将自动解决,但是现在,正确的解决方法是将新位置手动添加到Assembly Load Paths(您已经完成)中。
将程序集的副本加载到publish文件夹中的问题似乎是由于Full Framework处理非Windows程序集的问题引起的,此限制应在以后的Dotfuscator更新中解决。