Question

Currently I have Entity Framework 5.0 installed in Visual Studio 2012. For some reason the project only is supported by EF 4.4.0.0.

So I installed EF 4.4.0.0 but I have the error in the Nuget command line:

PM> Install-Package EntityFramework -Version 4.4.0.0 Install-Package : Unable to find version '4.4.0.0' of package 'EntityFramework'. At line:1 char:1 + Install-Package EntityFramework -Version 4.4.0.0 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

PM>

1
15
1/23/2013 7:42:39 PM

Accepted Answer

The versioning headache you are seeing is due to differences in what EF can support depending on what version of the .NET run time your app is targeting.

If you are targeting .NET 4 and install EF 5, the assembly version will be 4.4

If you are targeting .NET 4.5 and install EF 5, the assembly version will be 5.0

This is because things such as DBGeography only can work if .NET 4.5 is present.

Just install EF 5 proper and the NuGet package will figure this out and give you the proper version.

26
1/23/2013 7:48:19 PM

Popular Answer

tl;tr When you need assembly version 4.4.0.0 on .NET 4.0, just type into Package Manager Console:

PM> Install-Package EntityFramework -Version 5.0.0.0


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow