项目的默认 XML 命名空间必须是 MSBuild XML 命名空间 [英] The default XML namespace of the project must be the MSBuild XML namespace

查看:335
本文介绍了项目的默认 XML 命名空间必须是 MSBuild XML 命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地克隆了 ASP.NET Core SignalR Repo,并尝试从以下内容中打开解决方案环境.

I cloned the ASP.NET Core SignalR Repo locally, and try opening the solution from within the following environment.

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

我最终看到了很多此类错误消息:

I end up seeing a lot of these kinds of error messages:

..ReposSignalRsrcMicrosoft.AspNetCore.SignalRMicrosoft.AspNetCore.SignalR.csproj: 错误 : 项目的默认 XML 命名空间必须是MSBuild XML 命名空间.如果项目是在 MSBuild 2003 中创作的格式请补充xmlns="http://schemas.microsoft.com/developer/msbuild/2003" 到元素.如果项目是在旧的 1.0 或1.2 格式,请将其转换为 MSBuild 2003 格式...ReposSignalRsrcMicrosoft.AspNetCore.SignalRMicrosoft.AspNetCore.SignalR.csproj

..ReposSignalRsrcMicrosoft.AspNetCore.SignalRMicrosoft.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 add xmlns="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. ..ReposSignalRsrcMicrosoft.AspNetCore.SignalRMicrosoft.AspNetCore.SignalR.csproj

我想知道如何以正确的方式解决这个问题.

I want to know how to fix this the correct way.

推荐答案

您尝试打开的项目采用新的 .NET Core csproj 格式.这意味着您需要使用支持这种新格式的 Visual Studio 2017.

The projects you are trying to open are in the new .NET Core csproj format. This means you need to use Visual Studio 2017 which supports this new format.

稍微回顾一下历史,.NET Core 最初使用 project.json 而不是 *.csproj.但是,经过 Microsoft 的一些相当大的内部审议后,他们决定回到 csproj,但采用更简洁和更新的格式.但是,这种新格式仅在 VS2017 中支持.

For a little bit of history, initially .NET Core used project.json instead of *.csproj. However, after some considerable internal deliberation at Microsoft, they decided to go back to csproj but with a much cleaner and updated format. However, this new format is only supported in VS2017.

如果您想打开项目但又不想等到 3 月 7 日 VS2017 正式发布,您可以改用 Visual Studio Code.

If you want to open the projects but don't want to wait until March 7th for the official VS2017 release, you could use Visual Studio Code instead.

这篇关于项目的默认 XML 命名空间必须是 MSBuild XML 命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆