I am trying to update my Object Context of a legacy project that we have. I don't know if it is a bug or something else, but even if we explicitly tell Visual Studio to use version 4 of EF, it updates to version 5 messing everything up. Always I have to go back to Visual Studio 2012 and make my changes. Is there a reason for that?
Asked
Active
Viewed 349 times
4
-
How are you explicitly telling it to use version 4? – Scott Chamberlain Feb 07 '14 at 19:55
-
Update wizard ask me which version I want to use before start. – Cleiton Feb 07 '14 at 20:07
-
Are you targeting .NET 4.0 or .NET 4.5? Entity Framework 5.0 is automatically used if targeting .NET 4.5. – BJ Myers Feb 07 '14 at 21:01
-
Yes, I'm. But it seems to be a bug, Am I wrong? – Cleiton Feb 10 '14 at 20:06
-
Which version of .NET are you targeting? Is it 4.0, or is it 4.5? And what version of entity framework are you updating from? – BJ Myers Feb 10 '14 at 21:18
-
4See this thread: http://social.msdn.microsoft.com/Forums/en-US/5325334d-1b49-4c80-9f2e-b379815078c5/visual-studio-2013-ef-designer-and-ef-4-namespace-problem?forum=adodotnetentityframework and this SO question which might be relevant to your problem: http://stackoverflow.com/questions/19923156/how-to-use-entity-framework-4-with-visual-studio-2013 – Matthew Feb 10 '14 at 22:29
1 Answers
1
-In Solution explorer in References remove the existing reference to Entity framework 5.
-In packages.config remove the line that has EntityFramework version 5
-In View->Other Windows -> Package Manager Console, paste the next line: Install-Package EntityFramework -Version 4.1.10331.0
It works in VS2012, hope it works in 2013 too.

Alejandro del Río
- 3,966
- 3
- 33
- 31