1
votes

My azure websites deployment is failing. Everything is working fine on my local machine: I can't see any problems or conflicts when log verbosity is set to detailed in Visual Studio's output window.

But I can't figure out how to see logs and fix the following error in Kudu when trying to deploy to Azure:

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\14.0\bin\amd64'. All packages listed in packages.config are already installed. MyProject.Broadbean -> D:\home\site\repository\MyProject.Broadbean\bin\Release\MyProject.Broadbean.dll MyProject.Domain -> D:\home\site\repository\MyProject.Domain\bin\Release\MyProject.Domain.dll MyProject.Mandrill -> D:\home\site\repository\Mandrill\bin\Release\MyProject.Mandrill.dll D:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [D:\home\site\repository\MyProject.WebUI\MyProject.WebUI.csproj] D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(242,5): warning : No compiler log specified, 'Clean' won't work. [D:\home\site\repository\MyProject.WebUI\MyProject.WebUI.csproj] CSC : error CS1703: 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\MyProject.WebUI\MyProject.WebUI.csproj] CSC : error CS1703: Multiple assemblies with equivalent identity have been imported: 'D:\home\site\repository\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll' and 'D:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\Facades\System.ComponentModel.Annotations.dll'. Remove one of the duplicate references. [D:\home\site\repository\MyProject.WebUI\MyProject.WebUI.csproj] Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\MyProject.WebUI\MyProject.WebUI.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d69b9dee0afc5a";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\79.20129.3767\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

How do I see this build log in Kudu or the Azure websites environment and fix these errors? I'm obviously missing something. The background is that I updated a lot of nuget packages, the site now breaks on deployment, and I can't quite figure out how to fix it.

3

3 Answers

0
votes

To fix the "Multiple assemblies with equivalent identity have been imported. Remove one of the duplicate references." error, I removed the references for those assemblies.

That allowed me to deploy. But on deployment I got error screens because of conflicts between different assemblies.

To fix the "Found conflicts between different versions of the same dependent assembly that could not be resolved." conflicts, I removed the binding redirects for problematic assemblies in the web.config file.

0
votes

What it is trying to say that

.net framework itself has System.Xml.ReaderWriter.dll so you don't have add it separately. Please remove any reference of System.Xml.ReaderWriter.dll from your project . similarly you have to do it for other assemblies .

-1
votes

Please debug you deploy.cmd using log in every steps which you think could cause build failure. It seems that due to nuget update in your project, you have conflicts between different versions of the same dependent assembly. Please look at the assemblies you have upgraded and check their compatibility in your project.

I believe you must be running your build using some build agent, if you have access to the build agent and log in to the VM and try to debug your cmd file.

Also, please replicate and install the same environment in your Agent VM as you have it in your local, most of the time , this is the reason of build failure.

Hope it helps.