0

(Let me preface the question with Yes, I have seen similar questions, but not exactly my scenario.)

My environment is

Microsoft Visual Studio Professional 2015 (version 14.0.25431.01 Update 3)

My actions

  1. I create a new C# Class Library Project; (Ok)
  2. It defaults to .NET Fx 4.5.1, I change it to the latest on my machine Fx 4.7.2; (Ok)
  3. I Build / Compile it; (Ok)
  4. I go to the Manage NuGet Packages menu, search for EntityFramework, and try to install the latest; it tells me it is EF 6.3.(Ok)
  5. Hit the install button (ERROR - see message below)
  6. WTF (?) I've used this VS 2015 for 5 years (yes it is 2019 now) without fail, why fail now?

Output window

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

What I think is happening:

Whoever prepared the NuGet EF 6.3 package has not tested it with VS2015 ? Any ideas on a solution, please.

joedotnot
  • 4,810
  • 8
  • 59
  • 91
  • Update. Solution for now is to downgrade to EF 6.2.0, it works like a charm. I will provide this as a self-answer (when the appropriate period has elapsed), unless someone comes up with a better solution. – joedotnot Oct 11 '19 at 08:52
  • have you tried the latest daily with the fix? – magicandre1981 Oct 13 '19 at 16:33
  • @magicandre1981 not yet, I have the downgrade to 6.2 workaround. – Where exactly would I add the Nuget.Config, thru visual studio or directly on the file system, and at which level? my solution currently has two projs, do I add at the soln level or to the proj that uses EF6 ? – joedotnot Oct 13 '19 at 23:07
  • add the nuget.config next to the sln file. – magicandre1981 Oct 14 '19 at 14:17
  • there is also a 6.4 preview1 on nuget which should include the fix.so enable the checkbox for pre-release versions. – magicandre1981 Oct 23 '19 at 15:07
  • update to [6.4.0](https://www.nuget.org/packages/EntityFramework/6.4.0) – magicandre1981 Dec 05 '19 at 15:47

2 Answers2

0

This is a bug in EF6.3 which is already fixed and included in 6.4.

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
  • Could you please look at my question? It's similar but it's failing on Azure: https://stackoverflow.com/questions/58617182/azure-deployment-error-msb4041-the-default-xml-namespace-of-the-project-must-b – nmit026 Oct 30 '19 at 00:43
0

Here is my solution, i created new project and i selected .netframework 2.0 or 3.0 then i install the entityframework and its works

Xlayer
  • 17
  • 6