错误 BC32210:已导入多个具有相同标识的程序集

error BC32210: Multiple assemblies with equivalent identity have been imported

我有一个应用程序正在尝试使用开发中心部署到 Azure。该应用程序在本地运行良好,但当我签入我的代码并且 Azure 启动部署过程时,它失败并显示以下消息参考 System.Xml.ReaderWriter.4.3.1:

error BC32210: Multiple assemblies with equivalent identity have been imported

该消息令人困惑,因为我的 packages.config 仅引用程序集一次并且应用程序在本地构建良好。

如何解决这个问题?

这是完整的日志条目:

Command: "D:\home\site\deployments\tools\deploy.cmd" Handling .NET Web Application deployment. MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild.0\bin\amd64'. Restoring NuGet package System.Xml.ReaderWriter.4.3.1. GET https://api.nuget.org/v3-flatcontainer/system.xml.readerwriter/4.3.1/system.xml.readerwriter.4.3.1.nupkg OK https://api.nuget.org/v3-flatcontainer/system.xml.readerwriter/4.3.1/system.xml.readerwriter.4.3.1.nupkg 300ms Installing System.Xml.ReaderWriter 4.3.1. Adding package 'System.Xml.ReaderWriter.4.3.1' to folder 'D:\home\site\repository\packages' Added package 'System.Xml.ReaderWriter.4.3.1' to folder 'D:\home\site\repository\packages'

NuGet Config files used: C:\DWASFiles\Sites#1asdffdsa__fb6e\AppData\NuGet\NuGet.Config

Feeds used: D:\home.nuget\ https://api.nuget.org/v3/index.json

Installed: 1 package(s) to packages.config projects vbc : error BC32210: Multiple assemblies with equivalent identity have been imported: 'D:\home\site\repository\packages\System.Xml.ReaderWriter.4.3.1\lib\net46\System.Xml.ReaderWriter.dll' and 'D:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\Facades\System.Xml.ReaderWriter.dll'. Remove one of the duplicate references. [D:\home\site\repository\DiocesanClaims\DiocesanClaims.vbproj] Failed exitCode=1, command="D:\Program Files (x86)\MSBuild.0\Bin\MSBuild.exe" "D:\home\site\repository\DiocesanClaims\DiocesanClaims.vbproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Tempd70fa465288676";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:\home\site\repository.\" An error has occurred during web site deployment. \r\nD:\Program Files (x86)\SiteExtensions\Kudu.10503.3890\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

我不确定到底是什么问题或为什么会出现问题,但幸运的是,我不需要有问题的程序集。我从 Nuget 包列表中卸载了它,之后我就可以正常部署了。