Jonathan Wood
Jonathan Wood

Reputation: 67175

Entity Framework not appearing in Add New Item list in Visual Studio 2017

I created a new MVC project in Visual Studio 2017. I wanted to add an EDMX file (I will be doing database-first) so right clicked on the project and selected Add|New Item.

However, I cannot find the Entity Framework components that were available in the previous versions of Visual Studio. Does anyone know where they went?

enter image description here

Upvotes: 17

Views: 37575

Answers (4)

Bojo
Bojo

Reputation: 313

I know this is late, but I ran into the same exact issue. After reading some of the other answers, I realized I had created a .Net project with Standard library instead of the Framework library.

Upvotes: 6

Sachin Cholkar
Sachin Cholkar

Reputation: 89

I faced this issue, while creating an MVC application on my latest installation of VS2017.

Failed: Tried installing Entity Framework using Nuget package manager[Install-Package EntityFramework], but failed to show Ado.NET Entity data model

Success: 1. open programs under control panel and select Visual Studio 2017 2. select Change the installation 3. Select Modify installation 4. Select Individual components 5. If SQL server data tools already installed, deselect/uninstall this component and reinstall the same again. 6. uninstall and reinstall SQL Server Data tools

Note: with one component change, other components may also be deleted. You have to recheck while reinstalling

Upvotes: 4

Ricky
Ricky

Reputation: 3072

I had a similar issue today after i updated my VS to the latest 2017 version. I tried to open an .edmx file in VS2017 and it didn't show the designer view. So i realised i forgot to select Entity Framework tools during the installation:

enter image description here

Everything is back to normal :)

Upvotes: 15

Jaime Still
Jaime Still

Reputation: 1998

In .NET Framework-based projects, the Entity Framework 6 templates are still there. However, for .NET Core-based projects, I believe you're expected to use the dotnet ef commands. This includes a means of scaffolding a code-first DbContext from an existing database. See ASP.NET Core - Existing Database.

To verify this, I setup a demo project with the following structure:

solution-explorer

The New Item/Data dialog for the .NET Framework project:

framework-new-item

Note that there is also an EF POCO Generator template available in the Online templates section that may be of interest to you:

core-poco-generator

Upvotes: 13

Related Questions