Dotfuscator:找不到Microsoft.AspNetCore.Hosting.Abstractions Version=3.0.0.0



直到今天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:codequantDotfuscatedMap_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:codequantQuantWSbinReleasenetcoreapp3.0linux-x64QuantWS.dll
LOG: DisplayName = Microsoft.AspNetCore.Hosting.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
LOG: Appbase = C:codequantQuantWSbinReleasenetcoreapp3.0linux-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 Kits8.1ReferencesCommonConfigurationNeutral
LOG: Probing C:Program Files (x86)Windows Kits8.1ReferencesCommonConfigurationNeutralMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits8.1ReferencesCommonConfigurationNeutralMicrosoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits8.1ReferencesCommonConfigurationNeutralMicrosoft.AspNetCore.Hosting.Abstractions3.0.0.0Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits8.1ReferencesCommonConfigurationNeutralMicrosoft.AspNetCore.Hosting.Abstractions3.0.0.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.winmd       LOG: Not found in Windows Kit Folder.
LOG: Checking Windows Kit Folder : C:Program Files (x86)Windows Kits10References
LOG: Probing C:Program Files (x86)Windows Kits10ReferencesMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10ReferencesMicrosoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10ReferencesMicrosoft.AspNetCore.Hosting.Abstractions3.0.0.0Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10ReferencesMicrosoft.AspNetCore.Hosting.Abstractions3.0.0.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Checking Windows Kit Folder : C:Program Files (x86)Windows Kits10References10.0.17134.0
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.17134.0Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.17134.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.17134.0Microsoft.AspNetCore.Hosting.Abstractions3.0.0.0Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.17134.0Microsoft.AspNetCore.Hosting.Abstractions3.0.0.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Checking Windows Kit Folder : C:Program Files (x86)Windows Kits10References10.0.17763.0
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.17763.0Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.17763.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.17763.0Microsoft.AspNetCore.Hosting.Abstractions3.0.0.0Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.17763.0Microsoft.AspNetCore.Hosting.Abstractions3.0.0.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Checking Windows Kit Folder : C:Program Files (x86)Windows Kits10References10.0.18362.0
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.18362.0Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.18362.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.18362.0Microsoft.AspNetCore.Hosting.Abstractions3.0.0.0Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:Program Files (x86)Windows Kits10References10.0.18362.0Microsoft.AspNetCore.Hosting.Abstractions3.0.0.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.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 FilesMicrosoft SDKsAzure.NET SDKv2.9binpluginsDiagnosticsMicrosoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:Program FilesMicrosoft SDKsAzure.NET SDKv2.9binpluginsDiagnosticsMicrosoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.dll
LOG: Not Found in AssemblyFoldersEx paths.
LOG: Checking AssemblyFolders paths.
LOG: Probing C:Program FilesReference AssembliesMicrosoftFrameworkv3.5Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:Program FilesReference AssembliesMicrosoftFrameworkv3.5Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:Program FilesIISMicrosoft Web Deploy V3Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:Program FilesIISMicrosoft Web Deploy V3Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:Program FilesReference AssembliesMicrosoftFrameworkv3.0Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:Program FilesReference AssembliesMicrosoftFrameworkv3.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:Program Files (x86)Reference AssembliesMicrosoftFrameworkv3.0Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:Program Files (x86)Reference AssembliesMicrosoftFrameworkv3.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:Program Files (x86)Reference AssembliesMicrosoftFrameworkv3.5Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:Program Files (x86)Reference AssembliesMicrosoftFrameworkv3.5Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.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:codequantQuantWSbinReleasenetcoreapp3.0linux-x64Microsoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:codequantQuantWSbinReleasenetcoreapp3.0linux-x64Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.winmd
LOG: Probing C:codequantQuantWSbinReleasenetcoreapp3.0linux-x64Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:codequantQuantWSbinReleasenetcoreapp3.0linux-x64Microsoft.AspNetCore.Hosting.Abstractions.dll.deploy
LOG: Probing C:codequantQuantWSbinReleasenetcoreapp3.0linux-x64Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.dll.deploy
LOG: Probing C:codequantQuantWSbinReleasenetcoreapp3.0linux-x64Microsoft.AspNetCore.Hosting.Abstractions.exe
LOG: Probing C:codequantQuantWSbinReleasenetcoreapp3.0linux-x64Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.exe
LOG: Probing C:codequantQuantWSbinReleasenetcoreapp3.0linux-x64Microsoft.AspNetCore.Hosting.Abstractions.exe.deploy
LOG: Probing C:codequantQuantWSbinReleasenetcoreapp3.0linux-x64Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.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 FilesdotnetsdkNuGetFallbackFoldermicrosoft.aspnetcore.hosting.abstractions2.1.1libnetstandard2.0
LOG: Probing C:Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.aspnetcore.hosting.abstractions2.1.1libnetstandard2.0Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.aspnetcore.hosting.abstractions2.1.1libnetstandard2.0Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Probing C:Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.aspnetcore.hosting.abstractions2.1.1libnetstandard2.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Checking NuGet Folder : C:Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.aspnetcore.hosting.abstractions2.2.0libnetstandard2.0
LOG: Probing C:Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.aspnetcore.hosting.abstractions2.2.0libnetstandard2.0Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.aspnetcore.hosting.abstractions2.2.0libnetstandard2.0Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Probing C:Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.aspnetcore.hosting.abstractions2.2.0libnetstandard2.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Checking NuGet Folder : C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.app.runtime.linux-x643.0.0-preview7.19365.7runtimeslinux-x64libnetcoreapp3.0
LOG: Probing C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.app.runtime.linux-x643.0.0-preview7.19365.7runtimeslinux-x64libnetcoreapp3.0Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.app.runtime.linux-x643.0.0-preview7.19365.7runtimeslinux-x64libnetcoreapp3.0Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Probing C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.app.runtime.linux-x643.0.0-preview7.19365.7runtimeslinux-x64libnetcoreapp3.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.ni.dll   LOG: Checking NuGet Folder : C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.hosting.abstractions2.0.0libnetstandard2.0
LOG: Probing C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.hosting.abstractions2.0.0libnetstandard2.0Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.hosting.abstractions2.0.0libnetstandard2.0Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Probing C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.hosting.abstractions2.0.0libnetstandard2.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Checking NuGet Folder : C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.hosting.abstractions2.1.1libnetstandard2.0
LOG: Probing C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.hosting.abstractions2.1.1libnetstandard2.0Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Probing C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.hosting.abstractions2.1.1libnetstandard2.0Microsoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Probing C:UsersEDZ.nugetpackagesmicrosoft.aspnetcore.hosting.abstractions2.1.1libnetstandard2.0Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.ni.dll
LOG: Not found in NuGet folders.
LOG: Checking additional folder : C:codequantQuantWSbinReleasenetcoreapp3.0linux-x64
LOG: Probing C:codequantQuantWSbinReleasenetcoreapp3.0linux-x64Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Strong name match failed
LOG: Checking additional folder : C:UsersEDZAppDataLocalTemp~QuantWS.8
LOG: Probing C:UsersEDZAppDataLocalTemp~QuantWS.8Microsoft.AspNetCore.Hosting.Abstractions.dll
LOG: Probing C:UsersEDZAppDataLocalTemp~QuantWS.8Microsoft.AspNetCore.Hosting.AbstractionsMicrosoft.AspNetCore.Hosting.Abstractions.dll
LOG: Not found in additional folders.
LOG: Loose binding enabled.  Probing for later versions.

当我在Visual Studio中查找IWebHostBuilder时,它位于C:Program FilesdotnetpacksMicrosoft.AspNetCore.App.Ref3.0.0-preview7.19365.7refnetcoreapp3.0Microsoft.AspNetCore.Hosting.Abstractions.dll.同一文件也位于发布输出目录中。但多特弗斯卡托就是无法接受他们,并说Strong name match failed.

直到今天还好。如果我将项目降级到 aspnetcore 2.2,问题就会消失。有人可以帮忙吗?

注意:我以 Dotfuscator 开发人员员工的专业身份回答

Dotfuscator 会自动尝试在它知道的位置定位引用程序集,但Microsoft最近添加了一些新的引用程序集 (.NETCore 3.0毕竟是一个预览版!未来的社区更新将添加这个新位置,这将自动解决此问题,但现在正确的解决方法是手动将新位置添加到程序集加载路径(您已经这样做了)。

在发布文件夹中加载程序集副本的问题似乎是由于完整框架处理非 Windows 程序集时出现问题,应在将来的 Dotfuscator 更新中解决此限制。

相关内容

  • 没有找到相关文章

最新更新