Reputation: 1259
I was trying to create an ASP.NET MVC web application in Visual Studio 2017. I need to take an EF database-first approach for the work.
Unfortunately I can't find the ADO.NET Entity Data Model template in my "Data" template folder:
I have tried following suggestions which didn't work for me.
NOTE: I have VS 2015 and VS 2017 both installed on my machine. Only VS 2017 has the problem.
I have created the ASP.NET MVC project as follows:
File -> New -> Project -> Web -> ASP.NET Web Application (.NET Framework) -> MVC
Does anyone know a solution for this problem?
Upvotes: 48
Views: 108206
Reputation: 11
If you can't go and create a new project, like me,
and your sure you have the right class library selected, what worked for me was doing a clean and build, then just opening a file from my solution explorer and whalah,
hope it helps this is quite a broad and versatile question
Upvotes: 0
Reputation: 766
I think you have added "Class Library (.NET Standard)" which is not supporting ADO.net Entity Data Model. You have to add "Class Library (.NET Framework)"
Upvotes: -1
Reputation: 1182
I was having same problem. In my case, Entity Framework 6 tools and SQL tool options under individual components were already checked. I tried to reinstall with same selected components and this worked for me.
Upvotes: 0
Reputation: 1
Visual Studio displays available projects according to the area where you clicked. Right Click on the project's name root -> add -> new item -> Data you will be able to select ADO.NET Entity Data Model
Upvotes: -1
Reputation: 540
I had to create a new project using .Net 4.5.2 then I was able to add the ADO.NET Entity Data Model.
Upvotes: 12
Reputation: 51
Make sure that you're right - clicking an appropriate project, not the solution.
The respective UIs look almost identical; they even have the same keyboard shortcut. The one from the solution will "miss" the Data tab if you expect it to be there; e.g. from screenshots.
Also make sure, as per previous posts that you have: a. A Project that supports Entity Framework and b. You did have the appropriate tools installed.
Upvotes: 0
Reputation: 73
Tools-->Click Get Tools and Features-->Click on Modify-->
Click on Individual components-->
Tick the CheckBox of Entity Framework 6 Tools
-->click on Modify
-->
You'll get a pop up window-->click on Retry(if it not closed, Click on Continue)
Now Launch VS and this time check in Data ADO.NET Entity Model will be added.
Please Check this Article http://dotnet-jigyasa.blogspot.com/2018/03/adonet-entity-data-model-missing-visual.html Worked for me.
Upvotes: 7
Reputation: 41
Basically what I found is when you choose .Net Core Project EF not shown under data tab. You need to choose .Net Framework Instead of .Net Core. Then you will find all the stuffs under data tab.
Upvotes: 2
Reputation: 61
i think you selected class library (.NET Standard) instead of class library (.NET framework), try to select class library (.NET framework) you will get it.
Upvotes: 6
Reputation: 11
Upvotes: -1
Reputation: 33417
It is true that this feature is not available in Core and this might not answer the question directly. But Core offers Reverse Engineering command line that I have used successfully for project with existing database.
What you need to do is just run the following command with in your Package Manager Console and it will Generate models for you based on the existing database:
Scaffold-DbContext 'Data Source=.\SQLEXPRESS;Initial Catalog=DbName;Integrated Security=True;MultipleActiveResultSets=True' Microsoft.EntityFrameworkCore.SqlServer
Or directly from command line using dot net.
dotnet ef dbcontext scaffold "Data Source=.\SQLEXPRESS;Initial Catalog=DbName;Integrated Security=True;MultipleActiveResultSets=True" Microsoft.EntityFrameworkCore.SqlServer
To learn more about this feature you can read more at Microsoft page:
https://learn.microsoft.com/en-us/ef/core/managing-schemas/scaffolding
Upvotes: 1
Reputation: 63
Visual Studio displays available projects according to the area where you clicked. Right Click on the project's name root -> add -> new item -> Data you will be able to select ADO.NET Entity Data Model
Upvotes: 0
Reputation: 1
Just simply open Visual studio setup
. If you already installed choose to modify section and tick .NET desktop development
option and install it.
Upvotes: -2
Reputation: 1
First change framwork into 4.5.2 in your project application property.enter image description here Just right-click on your application(not project solution) in solution explorer and select Add menu and select ADO.Net under Add Menu. Do whatever you want with ADO.NET. Good Luck.
Upvotes: 0
Reputation: 31
I was having the same problem in VS2017 Community Edition. I had previously tried following but none worked:
In the end upon closer investigation I had targeted the wrong
See Image: you should be selected .NET Framework instead of .NET Standard
For me changed to the correct project type while Targeting ".NET framework" instead of ".NET Standard" worked.
Upvotes: 2
Reputation: 1003
It seems you added "Class Library (.NET Standard)" which is not supporting ADO.net Entity Data Model. You may add "Class Library (.NET Framework)"
Upvotes: 42
Reputation: 69
Not a solution as such, but check that the project you've added is for .NET Framework and not .NET Standard. The templates for adding things such as ADO.NET Entity Data Model are included for .NET Framework.
Upvotes: 6
Reputation: 111
i my case my project->properties->target framework was 2.0, i change to 4.5 and know it works know i see the ado.net entity data model.
Upvotes: 1
Reputation: 11
Your tools for EF are missing. You need to run the installer again and from "select package" you need to select enitityframeworktools
to get the required options in your project.
Upvotes: 1
Reputation: 333
in my case ,I had used ADO .NET before so I knew it was installed ..so I just typed ADO in the search box on the upper right corner , and THERE it was , SOLVED ! hope this helps
Upvotes: 0
Reputation: 665
My solution was to copy an "edmx" file from another project to the project with asp.net core, and works perfect, with all the funtions, the problem is only in the templates availables in the list.
Upvotes: 0
Reputation: 1941
For those of you trying the other solutions and still not seeing the templates...
Perhaps you are attempting to add ADO EF to a .NET Core 2.0 project, and EF is not supported out of the box.
You have 2 options:
I recommend #1. VS 2017 doesn't actually have the full Core 2.0 SDK installed, nor is it available from the VS installer (which many comments here struggle with).
I know, confusing, right?
From Microsoft:
"You will need to download and install a version of the .NET Core 2.0 SDK that is appropriate to your platform. This is true even if you have installed Visual Studio 2017 version 15.3."
"In order to use EF Core 2.0 or any other .NET Standard 2.0 library with a .NET platforms besides .NET Core 2.0 (e.g. with .NET Framework 4.6.1 or greater) you will need a version of NuGet that is aware of the .NET Standard 2.0 and its compatible frameworks"
https://blogs.msdn.microsoft.com/dotnet/2017/08/14/announcing-entity-framework-core-2-0/
Now... got all that installed and still not seeing the ADO template? I believe that is because it is deprecated/obsolete. This is the way to get EF working in .NET Core: https://learn.microsoft.com/en-us/ef/core/get-started/aspnetcore/existing-db
Hope this helps! You're welcome.
Upvotes: 25
Reputation: 612
Upvotes: 48
Reputation: 21
To solve above problem you can modify Visual Studio 2017.You can follow these steps.
Go to Control Panel\Programs\Programs and Features of your computer.
Select Microsoft Visual Studio 2017, right click on it and change.
It will goes to Visual Studio Products window and now click on modify button.
Now tick ASP.Net and web development workload in Web & Cloud section and modify it.
Finally launch Visual Studio 2017.
Upvotes: 2