Missing Entity Data Model in VS 2012

12,347

Solution 1

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.

Solution 2

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

Share:
12,347
Michael
Author by

Michael

Updated on June 07, 2022

Comments

  • Michael
    Michael almost 2 years

    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

  • Michael
    Michael over 11 years
    Thanks for the try and effort, unfortunately I have aready reinstalled VS2012 and repaired it. VS2012 is from CD so I guess it must be release?
  • Michael
    Michael over 11 years
    I will give this a try when I get home, haven't seen this update! Thanks.
  • Yusubov
    Yusubov over 11 years
    As you may see from my last suggestion in Edit, it needs to be un-installed.
  • Michael
    Michael over 11 years
    Yes I have uninstalled it and installed it again several times and it did not work, turns out VS2012 needed to be updated (not that it told me...) Thanks
  • Wojciech Kulik
    Wojciech Kulik almost 11 years
    Thank you, you've saved my day! ;-)