How to find dbcontext template in Visual Studio 11 - visual-studio

I'm using database first approach to create a model with entity framework. In VS2010 after the model was generated I always choose a different code generation template (right click on diagram "Add new code generation item") then, in the dialog box, choose "DbContext Generator". This will instruct VS to generate POCO classes instead of the, very complex, standard class. When I tried to do the same in the Visual Studio 11 Developer Preview I can't find the template "DbContext Generator" in the dialog.
How can I add the dbcontext template to the Visual Studio 11 Developer Preview?
I saw I can use nuget but I'm unable find it when I do a search.

Can you add the Entity Framework Power Tools via the Extension Manager? Then in a class library, you can right-click and "Reverse Engineer Code First". That will pull your database in and create everything you need (no need for EDMX and TT files). You will need to have EF 4.1 installed or have added the EntityFramework NuGet package to your project before running reverse engineer.
I don't have VS 11 installed here, so can't check if the tools will install (I'm also not sure whether these features are being rolled into 11) but anyway will work great in 2010 as I frequently use it.
Richard

In February Microsoft release a dbContext Generator that works on Visual Studio 11 Beta.
The link to download this generator is:
http://visualstudiogallery.msdn.microsoft.com/da740968-02f9-42a9-9ee4-1a9a06d896a2?SRC=VSIDE
Hope it helps.

Related

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?
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:
Everything is back to normal :)
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:
The New Item/Data dialog for the .NET Framework project:
Note that there is also an EF POCO Generator template available in the Online templates section that may be of interest to you:
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.
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

Missing "Ado.Net Entity Data Model" on Visual Studio 2013

I have created new web project but I can't find ADO.net Entity DAta Model to add it.
How to fix it or Install it ?
Go to "C:\ProgramData\Package Cache" and search for "EFTools.msi".
You should find two files, just install the most recent one (it should be about 960KB). This fixed the problem for me.
i have the same problem, but there is no "EFTools.msi" in "C:\ProgramData\Package Cache" for me...
UPDATE :
i download and install "Entity Framework 6 Tools for Visual Studio 2012 & 2013" and it solved the problem \m/
Download Link
Some web tutorials show a 'ADO.NET data entity model' item in the 'Models->Add' menu. In VS2015 this menu item is not shown. You need to keep drilling down by selecting 'New Item...' and then further selecting 'Data' from the pop-up dialog.
My solution was none like the above.
The .msi file was nowhere in the folders suggested in prior answers, nor doing a search in my hard drive found any EFTools.msi instances.
So the failsafe approach came through this article (since the author appears to have completely removed the page from the server, I've changed the URL to a version of the page stored in Google's cache), which was poorly written by a chinese fella, so I'm gonna try to rewrite the steps in a clearer way:
The solution is as follows:
Open your VS2013 installation ISO (or pop the DVD in) and navigate to "\packages\EFTools" folder;
There you will find 2 files (a .cab file and a .msi file);
Copy both files to a directory on your hard drive;
[Optional]: You can create in that same directory, an empty .txt file ("Log.txt") so that the installation log output will be redirected to it later;
Open a MS-DOS command prompt (with administrative rights) and type the command: EFTools.msi USING_EXUIH=1 /log "Log.txt" [NOTE: If you did not perform step #4, then you do not need to type from the ' /log' on (inclusive)]
Wait patiently while the installation process finishes. Takes quite some time (guess never hurts to remind you that this needs to be done with VS2013 closed). The installation should go fine, anything weird will be logged into the text file (the one you created in step #4).
Or, you might just double-click the .msi file if you are feeling brave..
After installation, open VS2013 and try adding a new item to the Models folder. The "ADO.NET Entity Data Model" should have reappeared under the "Data" tab.
Recognition goes to the anonymous chinese poster on that link (er, "Melinda"?) - xiè-xiè!
Be sure you are trying to do that in .Net Framework project. For example, when you are creating a project do not use a template called Windows Forms App (.Net Core), use Windows Forms (.Net Framework). The (.Net Framework) extension is important.
right click on your project--> properties---> framework target select 4.5 and should work.
It's only for Visual Studio 2012. For me this had no effect on 2013.
For the record, if you have Visual Studio 2015 RC, the "EFTools.msi" can't be downloaded from Microsoft
If you accidentally delete the "ProgramData" folder, the Repair option will not work, you have to use the Add or Remove features option from the installer, and check the SQL Server Data Tools
Make sure the type of project you've added is for .NET Framework and not for .NET Standard. The templates for adding things such as ADO.NET Entity Data Model are included for .NET Framework.
For Visual Studio 2017 the following works.
Create project:
Create new project of type 'Class Library'
Install 'Entity Framework' from NuGet
Now add datamodel:
In project click 'Add New Item'
Select 'Visual C# Items' -> 'ADO.NET Entity Data Model'
I recently added Entity Framework and installed in one of my many projects in a single sln file.
The thing is Entity Framework works on Framework higher than 3.5.
So Class Library of NET Standard wouldn't support Entity Framework, thus missing Ado.Net Entity Data Model, Since NET Standard console Library is Framework 2.0, changing the class Library to .NET Framework one, will include Ado.Net Entity Data Model.
I had the same issue, but found out that I was selecting ASP.NET Core web App, ASP.NET Core web App(MVC) etc, Instead Choose ASP.NET Web Application (.NET Framework) and you will get the ADO.NET Entity Data Model option.
Go to visual studio installer.
Add:
Entity framework tool 6
Download and install it.

Cannot see "Add code generation item" option

Situation:
I've got a project in Visual Studio. I added an edmx EF 4.2 model using a Database Project as the source. I now want to create the DbContext generator.
Problem:
However, when I right-click the design surface of the .edmx model, I do not see an "Add code generation item" option. What am I missing?
Background:
Here's the tutorial I'm using: http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-model-amp-database-first-walkthrough.aspx
I'm using the Visual Studio 11 Developer Preview, and Entity Framework 4.2 (via NuGet).

I cannot find template ADO.NET Entity Data Model in VS2010

In VS2010, I cannot find the template ADO.NET Entity Data Model from the Data section.
I was doing:
create a silverlight(version 4th) project with a WebSite
right click the web project, Add -> New Item -> Data Section(actually, I tried every one)
But I cannot find it!! It's weird!
Then,
I tried to reset my VS template, it didn't work
Tried to re-install VS2010, and I got the "Successful" message. also I am sure that the ADO.NET Entity Framework has been installed appropriately.
So, is there anything else I can do? can I just install this template to VS?
i believe you can add a ADO.NET Entity Data Model in a windows class library
and reference that library where it is required. but you cannot add the data model in a silverlight library.
Update:
in that case, i presuming the website is atleast targeting version 3.5 of the framework
for vs2010, you can check that the required template is available at the locations below
'%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Data\1033\AdoNetEntityDataModelCSharp.zip'
'%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\VisualBasic\Data\1033\AdoNetEntityDataModelVB.zip'
'%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\Web\CSharp\1033\AdoNetEntityDataModelCSharp_ASPNET.zip'
'%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\Web\VisualBasic\1033\AdoNetEntityDataModelVB_ASPNET.zip'
(in a x64 environment use 'Program Files (x86)' for %programfiles%)
hope that helps.
-ryan

Is anyone aware of an Object Manager Enterprise plugin for Visual Studio 2010?

I'm using DB4O on a new project I'm playing with and it would help me no end if I was able to use the Object Manager Enterprise utility. I understand it's only available as a VS plugin, so does anyone know whether such a plugin is / will be available for Visual Studio 2010, or is there another way to get the utility?
Currently there's no Object Manager version available for Visual Studio 2010. =(
A few suggestions for alternatives:
When you still have Visual Studio 2008 or 2005 installed, you can use the existing Object Manager for these versions.
You can use LINQPad for db4o as suggested here on SO. However this only works together when you load your domain model into LINQPad
You could use the Object Manager plugin for Eclipse. This version is distributed with the Java-version of db4o. So you need to download Eclipse and the java-db4o distribution. However this version of the Object Manager doesn't fully understand the .NET types, so some object are correctly displayed.
OME will be available for VS2010 when we introduce .Net 4.0 support.
Meanwhile you can try to install the OME that comes with db4o .Net 3.5 package and change the configuration file OMAddin.AddIn from "%mydocuments%\Visual Studio 2008\Addins\" to "%mydocuments%\Visual Studio 2010\Addins\" (if this folder doesn't exist just create it)
Then, open OMAddin.AddIn and change the line:
<Version>9.0</Version>
to
<Version>10.0</Version>
Now after starting VS 2010 OME should work and you should be able to see its toolbar (I have this procedure with VS 2010 beta2 and it worked).
Best
Adriano

Resources