postgresql - Can't generate database from .edmx (Npgsql 2.2.5/EF6) -
i can connect postgresql database fine (i generated .edmx way in first place), can't generate database .edmx.
the error indicates no provider invariant name 'npgsql' has been found, , entityframework section of web.config should checked it, far can tell it's here.
this asp mvc5 application, here's web.config:
<configuration> <configsections> <section name="entityframework" type="system.data.entity.internal.configfile.entityframeworksection, entityframework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" requirepermission="false" /> </configsections> <connectionstrings> <add name="pgarcher" connectionstring="host=localhost;database=archerie;user=postgres;password=***" providername="npgsql" /> <add name="archerieentities" connectionstring="metadata=res://*/archerieedm.csdl|res://*/archerieedm.ssdl|res://*/archerieedm.msl;provider=npgsql;provider connection string="port=5432;timeout=15;pooling=true;minpoolsize=1;maxpoolsize=20;commandtimeout=20;compatible=2.2.5.0;host=localhost;database=archerie;user id=postgres;password=***"" providername="system.data.entityclient" /> </connectionstrings> <appsettings> <add key="webpages:version" value="3.0.0.0" /> <add key="webpages:enabled" value="false" /> <add key="clientvalidationenabled" value="true" /> <add key="unobtrusivejavascriptenabled" value="true" /> </appsettings> <system.web> <authentication mode="none" /> <compilation debug="true" targetframework="4.5.1" /> <httpruntime targetframework="4.5.1" /> </system.web> <system.webserver> <modules> <remove name="formsauthentication" /> </modules> </system.webserver> <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="microsoft.owin" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="0.0.0.0-3.0.1.0" newversion="3.0.1.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="microsoft.owin.security.oauth" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="0.0.0.0-3.0.1.0" newversion="3.0.1.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="microsoft.owin.security.cookies" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="0.0.0.0-3.0.1.0" newversion="3.0.1.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="microsoft.owin.security" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="0.0.0.0-3.0.1.0" newversion="3.0.1.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="newtonsoft.json" culture="neutral" publickeytoken="30ad4fe6b2a6aeed" /> <bindingredirect oldversion="0.0.0.0-6.0.0.0" newversion="6.0.0.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="system.web.optimization" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="1.0.0.0-1.1.0.0" newversion="1.1.0.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="webgrease" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="0.0.0.0-1.6.5135.21930" newversion="1.6.5135.21930" /> </dependentassembly> <dependentassembly> <assemblyidentity name="antlr3.runtime" publickeytoken="eb42632606e9261f" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-3.5.0.2" newversion="3.5.0.2" /> </dependentassembly> <dependentassembly> <assemblyidentity name="system.web.helpers" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="1.0.0.0-3.0.0.0" newversion="3.0.0.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="system.web.webpages" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="1.0.0.0-3.0.0.0" newversion="3.0.0.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="system.web.mvc" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="1.0.0.0-5.2.3.0" newversion="5.2.3.0" /> </dependentassembly> </assemblybinding> </runtime> <system.data> <dbproviderfactories> <add name="npgsql - .net data provider postgresql" invariant="npgsql" description=".net data provider postgresql" type="npgsql.npgsqlfactory, npgsql, version=2.2.5.0, culture=neutral, publickeytoken=5d8b90d52f46fda7" /> <add name="dotconnect postgresql" invariant="devart.data.postgresql" description="devart dotconnect postgresql" type="devart.data.postgresql.pgsqlproviderfactory, devart.data.postgresql, version= 7.3.422.0, culture=neutral, publickeytoken=09af7300eec23701" /> </dbproviderfactories> </system.data> <entityframework> <providers> <provider invariantname="npgsql" type="npgsql.npgsqlservices, npgsql.entityframework, version=2.2.5.0, culture=neutral, publickeytoken=5d8b90d52f46fda7" /> </providers> </entityframework> </configuration>
- make sure installed npgsql , npgsql.entityframework in project (seems obvious, i've seen cases when people report errors yours , installed these packages in "repository" project).
- npgsql , mono.security must registered in gac (check version using).
and @ least, add assembly binding npgsql well:
<dependentassembly> <assemblyidentity name="npgsql" publickeytoken="5d8b90d52f46fda7" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-2.2.5.0" newversion="2.2.5.0" /> </dependentassembly>
Comments
Post a Comment