17

OK, so I feel dumb for asking this... but I am stumped.

I can't seem to create a project/unit for using the ADO.NET Entity Framework.

I looked for a project type that looked like it would match, but no go (closest I could find was ASP.NET Dynamic Data Entities Web Application).

I also tried to just add a unit (like you do for Linq-to-SQL). But I could not find anything "Entity Framework"y to add (though Linq-to-SQL is in the list). (Note: I tried adding it to a normal Class Library and to a WCF Project.)

Is there something I need to download? Is there an anti-stupid pill I need to take? ('cause I feel stupid for not being able to figure this out)

(I am using Visual Studio 2010 Ultimate connecting to SQL Server 2008)


Here is a screen shot of my Add New Item window:

Add New Item Window

I got this by right clicking on a Class Library Project and select Add New Item. There is no Entity Framework in it.

0

5 Answers 5

15

Begin with any Project (like a ClassLibrary) and Add an EF model.

There should be a "ADO.NET Entity Data Model" item in your "Add New Item" dialog.

Sign up to request clarification or add additional context in comments.

2 Comments

Alas there is not! (See my Updated Post) Is there something I need to install to get it?
It should have been part of a normal VS2010 install (even express). Try Repair.
3
  1. In the Solution Explorer, Right-click, Add New Item.

  2. Select ADO.NET Entity Data Model in the Templates pane.

  3. Give it a name, and click the Add button.

http://msdn.microsoft.com/en-us/library/bb399739.aspx

3 Comments

This option is not there. (See my Updated Post) Is there something I need to install to get it?
@Vaccano: Weird. It's supposed to be baked into VS2010 already. If you click on the "Data" option in the left-hand side of the dialog, does it show up?
Sadly no. I will just keep using Linq-To-SQL for now.
0

I see the item Data in installed templates in your image. Right click that to open the data related templates. he entity frame work related templates should be there.

Comments

0

The ADO.NET entity frame work data model project that you are referring to is actually an 'item' that must be added to an existing visual studio project. Reference: https://msdn.microsoft.com/en-us/library/jj206878(v=vs.113).aspx

If you create a class library and attempt to add a new item to it, then the ADO.NEW entity frame work data model 'item' will be available for addition to your class library or 'project'. Add Entity Frame Work Item to existing Project or Class Library

Comments

0

This just happened to me, but it was because I mistakenly created a Class Library (.NET Standard), which uses .NET 2.0. As soon as I created a Class Library (.NET Framework), I was able to add an Entity Framework file by choosing ADO.NET Entity Data Model.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.