Azure部署:错误MSB4041:项目的默认XML名称空间必须是MSBuild XML名称空间

问题描述:

我将像往常一样(使用Visual Studio Community 2019)继续部署Azure Web App,但现在遇到以下错误.

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"是解决方案的名称:

"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"

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"

这是我的WebApp.WebUI.csproj文件的开头:

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')" />

<?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')" />

更新:我已经降级到Entity Framework 6.2.0.现在正在工作,但这不是一个好的解决方案.问题出在Entity Framework 6.3.0软件包和/或它如何与我当前的配置交互.

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.

Entity Framework 6.4.0可以工作. (6.3.0不会.)

Entity Framework 6.4.0 works. (6.3.0 will not.)