Can't find ADO.net Entity Data Model template

2019-01-09 09:45发布

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:

enter image description here

I have tried following suggestions which didn't work for me.

  1. Installing Entity Framework 6.x via NuGet
  2. Installing package manually by double clicking latest msi file
  3. Changing .NET version from 4.6.x to 3.5

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?

16条回答
仙女界的扛把子
2楼-- · 2019-01-09 10: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.

查看更多
混吃等死
3楼-- · 2019-01-09 10:12

I had to create a new project using .Net 4.5.2 then I was able to add the ADO.NET Entity Data Model.

  1. File -> New Project
  2. Select Web -> ASP.NET Web Application (.NET Framework)
  3. Set Framework at bottom of window to .NET Framework 4.5.2 enter image description here
  4. Use Empty Template enter image description here
  5. Right click solution -> Add -> New Item
  6. Select Data -> ADO.NET Entity Data Model enter image description here
查看更多
男人必须洒脱
4楼-- · 2019-01-09 10:14

To solve above problem you can modify Visual Studio 2017.You can follow these steps.

  1. Go to Control Panel\Programs\Programs and Features of your computer.

  2. Select Microsoft Visual Studio 2017, right click on it and change.

  3. It will goes to Visual Studio Products window and now click on modify button.

  4. Now tick ASP.Net and web development workload in Web & Cloud section and modify it.

  5. Finally launch Visual Studio 2017.

查看更多
Juvenile、少年°
5楼-- · 2019-01-09 10:18

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.

查看更多
登录 后发表回答