When I'm trying to create an Entity data model i dont get the option "Code first from database". i only got "Generate from Database" and "Empty model"
Im using this tutorial: http://msdn.microsoft.com/da-dk/data/jj200620.aspx
Cant find any solution for this.
The new Entity Framework tooling is in Visual Studio 2013 Update 2 CTP 2...
http://www.microsoft.com/en-us/download/details.aspx?id=42023
You can also reverse engineer Code First models from an existing database using a Visual Studio addin such as Entity Framework Power Tools (some of them became the new tooling added to Update 2)...
http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d
Update the visual studio to the last version (update 4).
Tools - > extensions and update
Related
I installed EF Power tools in VS 2015 and i have entity framework nuget package version 6.1.3 and when i try to use reverse engineer code first, the tool doesn't work at all.
The tool creates the context class only with no table classes or mapping folder as it was working in VS 2013.
Any fix or workaround for this bug ?
You can just use the built-in EDM Wizard (Add New ADO.NET Entity data Model) to generate Code First from Database code. You could also consider using the "EF Reverse POCO Template" available on the VS gallery (in Tools/Extensions and Updates)
I am developping an application using Entity-Framework and Sql Server Compact 4 in a Visual Studio 2013 project.
Here is the list of add-ons I installed via NuGet :
Microsoft.SqlServer.Compact 4.0.8876.1
EntityFramework 6.1.3
EntityFramework.SqlServerCompact 6.1.3
Then I want to add an ADO.NET Entity Data Model ("Code First from database").
I choose a sdf file that I already have created with SQL Server Compact Toolbox. The Wizard find it and generate a connection string
Data Source=E:\[...]\myDBtest.sdf
Then I click "Next >", the Wizard becomes gray, freezes a few seconds and then closes itself without showing the following step.
At the end, it did not generate anything into my project.
I tried to rebuilt the project before adding the ADO item.
And I even tried to reboot the computer ... with no more success.
Any suggestion or same experience ?
Of course you can use Db First with EF and SQL Server Compact. In order to avoid the error, install the latest Visual Studio Tools for EF (6.1.3) https://www.microsoft.com/en-us/download/details.aspx?id=40762
In an EF project with an EDMX entity model, when I right click and hit Generate database from Model... I get the error:
An exception occurred while attempting to generate the database script from the model because the specified workflow file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\Generate T-SQL Via T4 (TPH).xaml' does not exist.
No XAML files featuring the word 'generate' exist at all on my hard disk. I thought I installed all I need with VS 2013 and the NuGet packages.
I also installed Entity Framework 6 Tools for Visual Studio 2012 & 2013 but no XAML files were added, the error still appears.
On MSDN, the generate database wizard is discussed under ADO.NET Entity Data Model Tools (http://msdn.microsoft.com/en-us/library/vstudio/bb399249(v=vs.100).aspx) but I can't find it to download online or from the VS extensions 'store'.
In Windows Programs and Features I have these items containing "entity":
Entity Framework 6.1.2 Tools for Visual Studio 2013
Entity Framework Designer for Visual Studio 2012 -enu
What am I missing?
I think my old project was set to use TPH but that strategy is no longer available, or was never available and I forgot that I installed the Powerpack to get it. Or maybe never used TPH.
This quote is interesting from a blog:
"Got the EF Powerpack that allowed generating TPH mappings." - http://www.jefim.eu/blog/2013/01/entity-framework-tpt-vs-tph.html
PowerPack here: https://visualstudiogallery.msdn.microsoft.com/df3541c3-d833-4b65-b942-989e7ec74c87
I seem to recall (I have been on a no-sql contract for years and last touched EF in v4) that I didn't like Table-per-Hierarchy and should be using Table-per-Type. I get the feeling that in the last couple of years, this has become the general feeling in EF or perhaps model-first was 'de-emphasised' in favor of code-first, which does support TPH and does database generation some other way? Guessing.
So I think the answer is that:
With Model-first, TPH is not available, use TPT.
If TPH is really wanted, then use the PowerPack (though it says VS2010) or maybe go code-first.
I have recently had issue using the Entity Framework 6.1.1 with my sqlite data provider. I was hoping to go back to EF 6.1.0 (I have update 2 installed) so I uninstalled Entity Framework 6.1.1 tools for visual studio 2013. After I did this I tried to add my Ado.Net entity data model but it has disappeared from the list of new items. Has anyone seen this?
You must install the old EF Tools again (select Repair VS in controlpanel->programs & features). This is also written in the docs.
I have installed EntityFramework 6.01 and have added a reference to my project. I closed Visual Studio 2012 and I then installed EF Power Tools Beta 4.
I re-opened Visual Studio 2012 and right-clicked my project containing dbContext. No entry appears in the context menu for Entity Framework. No error messages occurred during installation.
Are there additional pre-requisites to using EF Power Tools?
I think I have discovered the solution. My company uses VB.net as the standard development language. As a test, I started a C# project. Entity Framework Power Tools are fully present in the C# project. It appears that Entity Framework Power Tools are not yet available in VB.net projects.
Try right clicking on the project. I just looked at the beta 4 description and it does not reference EF 6. But the reverse engineer classes from database should show up with a right click on the project, indicating that at least the power tools installed correctly. These are the only comparability issues I could find:
Generate Views won’t work with prerelease versions of EF6.
It will, however, work with the RTM version when it’s released.
View Entity Data Model won’t work with EF6 on Visual Studio 2010.
Beta 4 updates the Power Tools to work with Entity Framework 6 and Visual Studio 2013. The following issues have also been fixed in this release.
Power Tools don't work when project is under a solution folder
Power Tools stop working when EF.dll is loaded into VS
Specific info found on the ado.net blog on msdn