Cannot generate DB from EDMX - XAML file does not exist - entity-framework

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.

Related

What's the quickest way to generate Entity Framework model code given an SQLite database?

I've got an SQLite database defined by an SQL DDL (CREATE TABLE etc.) script and am to derive Entity Framework model classes to work with it.
In the past, when I had an opportunity to try Visual Studio 2013 Ultimate and Microsoft SQL Server in the same situation, Visual Studio allowed me to use "database-first" approach and reverse-engineer the model to create the model classes automatically. But I can't find anything like that available in Visual Studio 2015 Community and SQLite.
Am I missing something or are there, perhaps, 3-rd party tools that can do the job to set me free of mechanically typing all the model code manually?
If you use VS Express you are out of luck, since you cannot install DDEX providers or any other extensions using that edition. Use Community, the download sqlite-netFx46-setup-bundle-x86-2015-1.0.104.0.exe from http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki (see my blogpost here for detailed info: http://erikej.blogspot.dk/2014/11/using-sqlite-with-entity-framework-6.html )
If you use EF Core, upgrade to Community, and install the latest daily of my VS extension SQLite Toolbox, which has a feature to generate an EF Core Model via GUI https://github.com/ErikEJ/SqlCeToolbox/wiki/Release-notes

EF reverse engineer code first doesn't work in VS 2015

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)

SQLite and Entity Framework 6

I have already visited those questions and problem solving links:
Entity Framework 6 + SQLite
Visual Studio 2013 say me Entity framework that the provider of SQLite is not found
http://entityframework.codeplex.com/wikipage?title=Rebuilding%20EF%20providers%20for%20EF6
I downloaded and installed the 1.0.92.0 SQLite Release Package from here http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
I create a new project (class library) in visual studio 2013.
Through NuGet I add System.Data.SQLite (which on itself also adds Core, EF6 and LINQ), EF is also installed.
I create the new ADO.NET Entity Data Model, I generate from the DB, select my DB (testing connection - ok), I go to "Which version of Entity Framework do you want to use?" and I have only the option "6" which is unavailable and it says:
Your project references the latest version of EF, however, an EF
database provider compatible with this version could not be found for
you data connection.
From what I have read, 1.0.92.0 should work with EF6 (even from 1.0.91.0)
I have done somé testing, and the SQLite support for the EF Tools appear to be completely broken, due to an incomplete implementation of the EF6 provider, which is also not installed in GAC. I would file an issue with the System.Data.SQLite developers

Can't find Code first from database when creating Entity Data Model

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

Entity Framework Power Tools does not appear in VS 2012

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