I want to create a Model First. For that created an empty project and added "ADO.NET Entity Data Model", "Empty EF Designer model". Added tables and want to "Generate Database from Model", but having the following error during Build:
But even though I am able to fetch tables from Database - "Update Model from Database". It adds tables from Database to Model, but reverse is not working with above error.Error 1 Running transformation: System.InvalidOperationException: The SSDL generated by the activity called 'CsdlToSsdlAndMslActivity' is not valid and has the following errors: No Entity Framework provider found for the ADO.NET provider with invariant name 'Npgsql'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
at Microsoft.Data.Entity.Design.DatabaseGeneration.EdmExtension.CreateAndValidateStoreItemCollection(String ssdl, Version targetFrameworkVersion, IDbDependencyResolver resolver, Boolean catchThrowNamingConflicts) at Microsoft.VisualStudio.TextTemplatingBF0D3C22AA28598FCC73795B901067ECB063D68581DCCB368A21EA6F043AE2089B71B51EA9D0340B9B3C9A5B90BC22C74D4C3BBD2BDC480DED3D26F1026A00DC.GeneratedTextTransformation.get_Store() in c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\GenerateTSQL.Utility.ttinclude:line 57 at Microsoft.VisualStudio.TextTemplatingBF0D3C22AA28598FCC73795B901067ECB063D68581DCCB368A21EA6F043AE2089B71B51EA9D0340B9B3C9A5B90BC22C74D4C3BBD2BDC480DED3D26F1026A00DC.GeneratedTextTransformation.TransformText() in c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\SSDLToSQL10.tt:line 84 c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\GenerateTSQL.Utility.ttinclude 57 1
I do not how to put image here, here is a link:
https://www.dropbox.com/s/gna5h091j5loo ... 4.png?dl=0
Here is my App.config
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="Npgsql.NpgsqlFactory, Npgsql" />
<providers>
<provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql.EntityFramework" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="Npgsql" />
<add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql" type="Npgsql.NpgsqlFactory, Npgsql" />
</DbProviderFactories>
</system.data>
<connectionStrings>
<add name="DefaultConnection"
providerName="Npgsql"
connectionString="server=127.0.0.1;userid=postgres;password=root;database=nagin" />
</connectionStrings>
</configuration>