Preview of useful design-time features for DbContext.
When right-clicking on a C# project, the following context menu function is supported:
1) Reverse Engineer Code First - Generates POCO classes, derived DbContext and Code First mapping for an existing database.
When righ...
1) Varchar(MAX) is throwing runtime error due to length issue.
2) Critical Issue: On taking recent VS.Net 2012 Update 1, I am receiving this error.
One or more errors occurred while processing template 'Entity.tt'. C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF.Utility.CS.ttinclude(1,4) : error : A processor named 'T4VSHost' could not be found for the directive named 'CleanupBehavior'. The transformation will not be run. The following Exception was thrown: System.InvalidOperationException: Cannot find processor for directive 'T4VSHost'. at Microsoft.DbContextPackage.Utilities.EfTextTemplateHost.Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost.ResolveDirectiveProcessor(String processorName) at Microsoft.VisualStudio.TextTemplating.Engine.ProcessCustomDirectives(ITextTemplatingEngineHost host, TemplateProcessingSession session, IEnumerable`1 directivesToBeProcessed)
One or more errors occurred while processing template 'Entity.tt'. C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF.Utility.CS.ttinclude(1,4) : error : A processor named 'T4VSHost' could not be found for the directive named 'CleanupBehavior'. The transformation will not be run. The following Exception was thrown: System.InvalidOperationException: Cannot find processor for directive 'T4VSHost'. at Microsoft.DbContextPackage.Utilities.EfTextTemplateHost.Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost.ResolveDirectiveProcessor(String processorName) at Microsoft.VisualStudio.TextTemplating.Engine.ProcessCustomDirectives(ITextTemplatingEngineHost host, TemplateProcessingSession session, IEnumerable`1 directivesToBeProcessed)
Great work. but it will be better if table's schama added to the namespace of its class. for ex. if my table is "Account" and its schema was "GL", the generated class would be mynamespace.GL.Account.
I'm using VS 2010 and the latest power tools. When trying to reverse engineer a database I keep getting the error "HRESULT 0x80070057 E_INVALIDARG". Test connection was successful, though. Any ideas how to fix this?
I'm unable to reverse engineer against a database that (very sadly) has a hyphenated name. I keep getting the error "The modelEntityContainerName parameter 'xxx-xxxContext' contains characters that are not valid". Is there any way to fix this? I sure could get some use out of this tool if there was! Oh, and believe me, I'm not the one who hyphenated the database name originally! Thanks, Landon
Generate Views: Generates select statements with Pluralized table name inspite of setting Plurarlize New Objects = false in Model First.
In Code First: Ignored the fact that the entities where reverse engineered from singular named tables and generates in view with pluralized tables.
also reverse engineer mapping template code line storeProp.TypeUsage.Facets.SingleOrDefault(f => f.Name == "StoreGeneratedPattern") always returns null and hence identity columns are not marked as identity. This libraries preview ctp came out around may 2011 and it is 1 1/2 years and is still in beta, doesn't support entities based on view and buggy.
Only problem I have is the inability to select the tables for which to generate POCO classes. All tables are processed so you have to delete the ones you don't want.
I've installed Beta 2 on a Windows 7 64-bit machine with Visual Studio 2010 SP1 and SQL Server 2012. After installation, the Server Explorer couldn't connect to the database, complaining that only versions up to SQL Server 2008 are supported.
Uninstalling PowerTools solved the problem, but left me without PowerTools...
Eugenio, I've same problem: System.InvalidOperationException: This operation requires a connection to the 'master' database. Unable to create a connection to the 'master' database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection. ---> System.Data.SqlClient.SqlException: Login failed for user 'sa'.
And I'm sure the Login info for 'sa' is correct, because in connection wizard, Test Connection is OK.
UPDATE ----------------- found the solution here: http://stackoverflow.com/questions/4324052/ef4-code-first-causes-invalidoperationexception
In connection wizard, Advanced should be clicked and the value of Persist Security Info should be True.
I am getting "Sequence contains no matching element" on click of "Generate Views" menu of Entity framework power tool (Beta 2). I am using Visual studio 2010 (premium) and entity framework 4.4
System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.DbContextPackage.Extensions.ProjectExtensions.InstallPackage(Project project, String packageId) at Microsoft.DbContextPackage.Handlers.ReverseEngineerCodeFirstHandler.ReverseEngineerCodeFirst(Project project)
One or more errors occurred while processing template 'Mapping.tt'. error : Running transformation: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.VisualStudio.TextTemplatingf34e03996f2d4022aad496a20b3137d6.GeneratedTextTransformation.TransformText() at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)
Hi, I am using Visual Studio 2010 and MySql 5.5. When i use the reverse engineer code first function, it always report errors, even i reverse the database with only one empty table. The exception below always appears. Is this tool support MySql? Can you give me some help? Thank you in advance.
One or more errors occurred while processing template 'Mapping.tt'. error : Running transformation: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.VisualStudio.TextTemplatingd98a42fc59ce43d99d01869c2b137080.GeneratedTextTransformation.TransformText() at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)