3

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

3
  • are you targeting same .NET Framework version in your projects under the solution?
    – Yusubov
    Jan 8, 2013 at 1:42
  • Yes, all projects are using .NET 4.0, I've even created several new solutions with one project.
    – Michael
    Jan 8, 2013 at 2:11
  • You need to check "Sql Server Data Tools" to get the designer. entityframework.codeplex.com/workitem/673
    – Pawel
    Jan 8, 2013 at 3:20

4 Answers 4

6

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.

1
  • I will give this a try when I get home, haven't seen this update! Thanks.
    – Michael
    Jan 8, 2013 at 16:48
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

3
  • 1
    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
    Jan 8, 2013 at 16:48
  • As you may see from my last suggestion in Edit, it needs to be un-installed.
    – Yusubov
    Jan 8, 2013 at 17:12
  • 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
    – Michael
    Jan 8, 2013 at 18:45
0

The accepted answer from here solved the problem in my case:

http://www.datazx.cn/Fv7p5a/xw-US/oaax2pu/2q7xs6/d8x6rssc-b4mt-fsix-bc6c-ct8mf8d6fsbc23rsdfd.html

I finally figured it out. I ran EFTools.msi from a C:\ProgramData\Package Cache\ subfolder, which only allowed me to 'uninstall' or 'repair'. I tried repair, but I get the same problem, so I did 'uninstall', then ran it again and it allowed 'install'. After this install, I can now add Entity Data Models.

Also, the accepted answer in the "Missing Entity Framework Template in Visual Studio 2012 Express for Web" threat on forums.asp.net suggests that repairing Entity Framework Designer for Visual Studio 2012 enu via 'Start -> Control Panel -> Programs and Features' might work as well (I can post only two links with my current 1 point StackOverflow reputation, so I won't provide the exact source).

Another possible solution:

My Problem was: Visual Studio is installed on Drive D:\, whereas the Entity Framework Installer placed the Package in c:...\VisualStudio 10.0\Common7....\ItemTemplates folder. --> Copied the AdoNetEntityDataModelCSharp.zip to drive d: and ran devenv /installvstemplates. This fixxed it for me. Edit: Also had to copy Various DLLs from IDE folder, PrivateAssemblies and PublicAssemblies. then run devenv /ResetSkipPkgs

http://social.msdn.microsoft.com/Forums/en-US/c059069b-eae4-48b4-a06e-ffd5f186077b/adonet-data-entity-model-template-missing-in-vs-2010-ultimate?forum=adodotnetentityframework

I also installed VS in a non-default path (different disk partition), so it indeed may be one of the potential causes of the problem.

0

You can right-click the designer surface and choose the model browser; Here is the only way to activate the Model browser in solution explorer. The Model browser is included in VS 2012 recommended settings during installation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.