Azure deployment: error MSB4041: The default XML namespace of the project must be the MSBuild XML namespace

azure entity-framework-6 msbuild visual-studio xml

Question

I'm continuously deploying my Azure Web App as usual (using Visual Studio Community 2019) but now I'm getting the following error.

(Also, I've already seen this question: The default XML namespace of the project must be the MSBuild XML namespace, but I'm only getting this error in the logs in the Deployment Centre of my Azure Web App, and that question relates to Visual Studio 2017.)

"WebApp" is the name of the solution:

D:\home\site\repository\packages\EntityFramework.6.3.0\build\EntityFramework.props(1,1): error MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. [D:\home\site\repository\WebApp.WebUI\WebApp.WebUI.csproj] Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\WebApp.WebUI\WebApp.WebUI.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d75ccda63e5816";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\84.10924.4104\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

Here's the start of my WebApp.WebUI.csproj file:

<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="..\packages\EntityFramework.6.3.0\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.3.0\build\EntityFramework.props')" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

UPDATE: I've downgraded to Entity Framework 6.2.0. It's now working, but this isn't a good solution. The problem is with the Entity Framework 6.3.0 package and/or how it interacts with my current configuration.

1
0
10/30/2019 8:58:12 PM

Accepted Answer

Entity Framework 6.4.0 works. (6.3.0 will not.)

1
2/25/2020 3:29:19 AM

Popular Answer

I think this issue has something to do with the msbuild version. I googled some similar issues and found that the EF6.3 requires at least VS2017 and higher. And if we use msbuild 14.0(VS2015) to build a web-project consuming EF6.3, we'll get same error like this:

enter image description here

Cause of your issue:

And according to your log(line7):Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" ,during that process, it's using msbuild 14.0(msbuild of VS2015). I think that's why you have that strange error.

1.To resolve that issue, in local machine, we need to use VS2017(msbuild15.0) or VS2019(msbuild16.0) to build that project.

The path of msbuild 15.0: C:\Program Files (x86)\Microsoft Visual Studio\2017\xxx\MSBuild\15.0\Bin

The path of msbuild 16.0: C:\Program Files (x86)\Microsoft Visual Studio\2019\xxx\MSBuild\Current\Bin

2.As for msbuild support for Azure: please check this issue. Now Azure has support for VS2017 build tools(msbuild 15.0), please try the useful info there to configure your deployment to use msbuild 15.0.

Hope it makes some help :)



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow