Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does VS 2015 need a reference to System.Data.Entity but VS 2013 does not?

I've installed VS 2015 (not the RC though I had that installed prior). I opened an existing solution that was working fine in VS 2013 and got the following error.

BC30652 Reference required to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' containing the type 'EntityObject'. Add one to your project.

I added a reference to System.Data.Entity in the project as VS suggested and it worked. However, I'm wondering why this happened.

If I remove System.Data.Entity reference, VS 2013 still works but VS 2015 throws errors. The project does have a reference to System.Data.

Notes about the solution:

  • Originally developed in VS 2013
  • .NET 4.0
  • Also has reference to System.Data
  • Has 2 projects, a main (which causes the error) and a DAL
  • The DAL has an Entity Data Model (.edmx)
like image 621
Tony L. Avatar asked Jul 24 '15 17:07

Tony L.


1 Answers

I got confirmation from the Visual Basic language team that this is very likely due to a change in their compiler in Visual Studio 2015:

... we actually did work to try to make things more permissive. But the summary is that the compiler may require more references for correctness. Add them if you can. I believe there is a quick fix for it if you invoke the light bulb.

like image 65
divega Avatar answered Sep 28 '22 08:09

divega