Visual Studio 2015错误。项目的默认XML名称空间必须是MSBuild XML名称空间

时间:2019-10-11 08:14:40

标签: visual-studio-2015 entity-framework-6 nuget-package

(让我以“是”作为问题的开头,我见过类似的问题,但并非完全符合我的情况。)

我的环境是

  

Microsoft Visual Studio Professional 2015(版本14.0.25431.01   更新3)

我的动作

  1. 我创建一个新的C#类库项目; (好)
  2. 默认为.NET Fx 4.5.1,我将其更改为我的机器Fx 4.7.2上的最新版本; (好)
  3. 我构建/编译它; (好)
  4. 我转到Manage NuGet Packages菜单, 搜索EntityFramework,然后尝试安装最新版本;它说 我是EF 6.3。(确定)
  5. 点击安装按钮(错误-参见下面的消息)
  6. WTF(?)我已经使用VS 2015五年了(是的,现在是2019年),为什么没有失败?

输出窗口

Attempting to gather dependency information for package 'EntityFramework.6.3.0' with respect to project 'SqliteLayer', targeting '.NETFramework,Version=v4.7.2'
Attempting to resolve dependencies for package 'EntityFramework.6.3.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'EntityFramework.6.3.0'
Resolved actions to install package 'EntityFramework.6.3.0'
Adding package 'EntityFramework.6.3.0' to folder 'C:\PROJS\test-proj-01\packages'
Added package 'EntityFramework.6.3.0' to folder 'C:\PROJS\test-proj-01\packages'
Install failed. Rolling back...
Package 'EntityFramework.6.3.0' does not exist in project 'MyProjName'
Removing package 'EntityFramework.6.3.0' from folder 'C:\PROJS\test-proj-01\packages'
Removed package 'EntityFramework.6.3.0' from folder 'C:\PROJS\test-proj-01\packages'
Microsoft.Build.Exceptions.InvalidProjectFileException: 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.  C:\PROJS\test-proj-01\packages\EntityFramework.6.3.0\build\EntityFramework.props
   at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args) ... etc etc.. etc... the rest I chopped off

我正在发生的事情:

谁准备的NuGet EF 6.3软件包尚未在VS2015中进行测试?请提供解决方案的任何想法。

2 个答案:

答案 0 :(得分:0)

这是bug in EF6.3already fixed,包含在6.4中。

答案 1 :(得分:0)

这是我的解决方案,我创建了一个新项目并选择了.netframework 2.0或3.0,然后安装了entityframework及其作品