Missing Entity Data Model in VS 2012

c# entity-framework visual-studio visual-studio-2012


I cannot find the Entity Data Model under the 'Data' tab when adding a new item.

I have looked at several questions and answers, information on this and none of the solutions have worked.

I have repaired, uninstalled and reinstalled, installed the EF Tools package manually and tried uninstalling all VS related programs. I have also tried creating several new projects, Class Libraries, Web Projects under different .NET frameworks and it isn't there.

Main project: Visual Studio 2012, Class Library Project .NET 4.0

1/8/2013 12:49:25 AM

Accepted Answer

I updated Visual Studio 2012 using this link: http://www.microsoft.com/visualstudio/eng/downloads#d-visual-studio-2012-update. After this update, the "Entity Data Model" option was added to the data tab.

3/11/2014 5:01:05 AM

Popular Answer

The new Entity Data Model in VS 2012 by default uses T4 templates (.tt) files instead of former custom tool for code generation. The generated context is also based newer DbContext API instead of ObjectContext API used by Visual Studio 2010 (that is the reason why it doesn't have the method - the equivalent method in DbContext API is Set<T>). Both T4 and DbContext API are currently recommended approach for using EF.

I don't have VS 2012 on my current machine but what you can try is to delete both .tt and turn on the old generation as described in .Desinger.cs.

Edit: You may try to Re-install VS2012 and/or repair it. That should fix this issue. In addition, look at the release version of your VS2012.

Another suggested solution to re-install and reason why this happens - Unable to add Entity data model to a Visual Studio project

Related Questions


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