我克隆了 ASP.NET Core SignalR Repo在本地,并尝试从以下环境中打开解决方案。
IDE
Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01055
DOT NET CLI
λ dotnet --info
.NET Command Line Tools (1.0.0-preview2-1-003177)
Product Information:
Version: 1.0.0-preview2-1-003177
Commit SHA-1 hash: a2df9c2576
Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
我最终看到了很多这样的错误消息:
..\Repos\SignalR\src\Microsoft.AspNetCore.SignalR\Microsoft.AspNetCore.SignalR.csproj
: error : The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please addxmlns="http://schemas.microsoft.com/developer/msbuild/2003"
to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format...\Repos\SignalR\src\Microsoft.AspNetCore.SignalR\Microsoft.AspNetCore.SignalR.csproj
我想知道如何以正确的方式解决这个问题。
最佳答案
您尝试打开的项目采用新的 .NET Core csproj 格式。这意味着您需要使用支持这种新格式的 Visual Studio 2017。
回顾一下历史,最初 .NET Core 使用 project.json
而不是 *.csproj
。然而,经过 Microsoft 内部的一番深思熟虑,他们决定回到 csproj
,但采用更清晰和更新的格式。不过,这种新格式仅在 VS2017 中支持。
如果您想打开项目,但不想等到 3 月 7 日才正式发布 VS2017,您可以改用 Visual Studio Code。
关于asp.net-mvc - 项目的默认 XML 命名空间必须是 MSBuild XML 命名空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42509313/