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条回答
Luminary・发光体
2楼-- · 2019-01-09 09:52

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.

查看更多
你好瞎i
3楼-- · 2019-01-09 09:53

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.

查看更多
乱世女痞
4楼-- · 2019-01-09 09:53

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

查看更多
别忘想泡老子
5楼-- · 2019-01-09 09:54
  1. Go to Tools -> Get Tools and features
  2. Select Individual components tab and check Entity Framework 6 tools under SDK's, libraries, and framework section
查看更多
别忘想泡老子
6楼-- · 2019-01-09 09:54

It seems you added "Class Library (.NET Standard)" which is not supporting ADO.net Entity Data Model. You may add "Class Library (.NET Framework)"

查看更多
聊天终结者
7楼-- · 2019-01-09 09:56

I was having the same problem in VS2017 Community Edition. I had previously tried following but none worked:

  • Installed new feature for "SQL Server Data Tools".
  • Installed NuGet Libraries.

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.

查看更多
登录 后发表回答