postgresql - How to add custom DB provider to be accessible in Visual Studio? -


i wanted work custom db provider in visual studio. need use entity framework.

for example, downloaded npgsql, registered them in gac:

gacutil  -i  c:\temp\npgsql.dll gacutil  -i  c:\temp\mono.security.dll 

and added machine.config file:

<add name="npgsql data provider" invariant="npgsql"  support="ff" description=".net framework data provider postgresql server" type="npgsql.npgsqlfactory, npgsql, version=2.0.6.0, culture=neutral, publickeytoken=5d8b90d52f46fda7" /> 

but npgsql did not appear in datasource list in visual studio:

data source in vs

how add custom db provider list?

upd: if use command string edmgen.exe got error:

error 7001: failed find or load registered .net framework data provider.

you need declare dbfactoryprovider in config file (web.config, machine.config, etc). here's sample 1 pulled project using mysql:

 <system.data>   <dbproviderfactories>     <remove invariant="mysql.data.mysqlclient"/>     <add name="mysql data provider" invariant="mysql.data.mysqlclient" description=".net framework data provider mysql" type="mysql.data.mysqlclient.mysqlclientfactory, mysql.data, version=6.3.6.0, culture=neutral, publickeytoken=c5687fc88969c44d"/>   </dbproviderfactories> </system.data> 

i prefer declaring these in application-level config files , have apps use local copy of assembly. helps portability since can't guarantee 3rd party provider available in gac.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -