Visual Studio 2017 not showing MySQL in connection list - c#

I am using "Visual Studio 2017 Professional". I can not get a project to recognize that MySQL is an available DB option. MySQL does not show up in the list of possible connections when I create a new model. I know that there are tons of SO questions and other web pages on this topic because I have tried a lot of the suggestions. Each is subtlety different in cause and solution. None of the solutions seem to work for me.
I have tried the following with VS 2017 and 2015 with the same results. I have older versions of VS available but it didn't seem worthwhile to march that far back. I have also tried installing the latest and older versions of MySQL both with the "Community Installer" and the standalone msi's when necessary. I went back to the "latest" pre-6.10 version of MySQL.
To begin, this saga started last week when I noticed that nuget had MySQL package updates available. I applied them and then went to upgrade the installed MySQL componants with the Community Installer. The nuget changes did apply. The Community Installer could not uninstall MySQL for VS though. The system installer could not uninstall it. Rebooting and power-cycling did nothing.
On the advice of our local tech support folks I used a third party uninstaller that turned out to be more aggressive than we imagined. It seems to have randomly stommped across the registry erasing whatever it found. Long story short(er), I ended up having my machine reimaged. So, I have a fresh windows install.
Given the fresh Win10 platform, I installed the various things I normally use including the VS versions I typically use. I installed the latest Community MySQL installer. I did a "custom" MySQL install because I don't need a server on this device or fabric or many other things.
I finished the basic reinstall of everything then rebooted just to be sure. I started VS 2017 and created a new web app with the latest available version of .Net (4.6.1). I applied nuget updates and added EntityFramework and MySQL.Data. I then tried to create a new "code first" model.
I can get to the point where I am asked to create a connection. When I click the button the list of available DB providers only shows MS SQL.
I have seen the articles that say to add lines to Web.config and I have seen the MySQL .Net Connector docs that say the same things. I can see the MySQL entries in Web.config but they do not show up when creating a connection.
An oddity is that I can go to Tools -> Connect to Database and see EVERY DB type my machine knows about including MySQL. I can create the connection string and it works. I can see the DB in "Server Explorer` but that doesn't make it available to code.
Ok, I have followed the above steps over and over including downgrading the version of EntityFramework as well as the MySQL version.
My most recent attempt has me back to the latest version of VS and MySQL. The relevant (I think) section of the Web.config file follow. Note the defaultConnectionFactory entry is LocalDbConnectionFactory. I have changed that to SqlConnectionFactory but it has not made a difference. I have also changed the order of the providers and the order of the major blocks.
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient"
type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySql.Data.MySqlClient"
type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</provider>
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add description=".Net Framework Data Provider for MySQL" invariant="MySql.Data.MySqlClient"
name="MySQL Data Provider"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.10.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
Edit
My current impression is that VS 2017 is an unusable mess masquerading as a released, salable product. I have returned to 2015.
I have come closer to getting this to work in 2015. I have the latest MySQL items for VS and .Net installed. I have downgraded the nuget EF package to 6.0 and the MySql packages to 6.8.8.
In, what I am now calling, "the good old days" I could add a new model to an MVC project by selecting the Models folder; selecting "Add New Item"; choosing ADO.Net model; select a connection option (MySQL); enter the connection info; choose DB First or Code First and wait for the scaffolding fun to finish.
Now, I have to first go to Tools -> Connect to Database and create a conenction to a MySql DB. If I do not do this I will not see MySQL in the list of possible connections later. I then clean and build the project. Next i try to create the model as above. Noe I can see the MySQL connection option and I can enter the DB creds and test the connection.
The next step is to choose DB First or Code First. In either case, clicking the "next" button flashes a blank pop-up that then vanishes. No errors are shown and no connection is made.
It was never this hard in the past.
I have tried a lot of different MySQL and EF versions on 2015 and 2017 at this point. If there is a magic combo please tell me.

I have been fighting this fight for two weeks. I FINALLY found a combo of versions that works for me. The following was applied to a pristine re-image of my Win10 desktop two weeks ago. All patches were applied to system software before starting to deal with MySql.
Just this morning I re-read the post in this thread (MySql Forums): https://forums.mysql.com/read.php?174,659102,660369#msg-660369
I thought that I had tried those suggestions before but I must have messed up one of the versions. I think that poster's basic strategy is sound. In my case I uninstalled all local MySql parts and the installer.
I downloaded MySQL for Visual Studio - the Latest Development version (2.0.5 msi as of this writing) and installed that.
I found the OLD versions of the .Net Connector and installed 6.9.11
In VS 2017 I created a dummy project using .Net 4.6.1.
I applied pending VS updates.
I built the project.
I went to "Project -> Manage Nuget Packages" and installed / downgraded EntityFramework to 6.0.
I installed MySql.Data, MySql.Data.Entity and MySql.Web all at version 6.9.11
I cleaned and built the project then tried to add a new "Code First" model from a MySql DB... IT WORKED!

Thank you 7 Reeds for coming back with an answer. It led me to get it working, although I did it slightly differently.
In VS 2017 to connect to MySQL 5.6:
Uninstall any MySQL products from the machine
Set Target framework to .NET Framework 4.5.2
Uninstall EntityFramework and any MySQL packages in Nuget
Install MySql.Data.Entity (6.10.7)
It will also install the needed versions of the Nuget packages MySql.Data (6.10.7), EntityFramework (6.1.3), and BouncyCastle (1.8.3.1).
The MySql.Data.Entity package says it depends of Google.Protobuf, but it didn't install it and it works fine for me.
It added References in my project to BouncyCastle.Crypto (1.8.3.0), EntityFramework (6.0.0.0), MySQL.Data (6.10.7.0), and MySql.Data.Entity.EF6 (6.10.7.0).
Close Visual studio
Install 'MySQL for Visual Studio' (1.2.8)
Install 'Connector/NET' (6.10.7)
Delete the bin and obj folders
Open Visual Studio and Rebuild Solution
Add New Item > ADO.NET Entity Data Model > Now you're in the wizard
Select EF Designer from database
On the next screen ('Entity Data Model Wizard'), click New Connection...
On the 'Connection Properties' screen click the Change... button for the 'Data source'
You should be able to select the MySQL Database as the 'Data source'
The 'Data provider' should auto-populate with .NET Framework Data Provider for MySQL
Yay! Continue on like you normally would
For posterity, here's the app.config for my WPF application:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v13.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.10.7.0" newVersion="6.10.7.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<connectionStrings>
<add name="MyDB" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string="server=my.example.com;user id=NotMyRealUserID;password=NotMyRealPassword;persistsecurityinfo=True;database=MyDatabase"" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
I'm not sure what created this, but I have a 'User variable' in my 'Environment Variables' named MYSQLCONNECTOR_ASSEMBLIESPATH with value C:\Program Files (x86)\MySQL\MySQL Connector Net 6.10.7\Assemblies\v4.5.2

At appsettings.json:
"ConnectionStrings": { "DefaultConnection": "Server=localhost;database=MusicStoreDB;user id=root;Charset=utf8;" },
At ConfigureServices() in Startup.cs :
using Microsoft.EntityFrameworkCore; using MySql.Data.MySqlClient; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection;
... services.AddDbContext(options => options.UseMySQL(Configuration.GetConnectionString("DefaultConnection")));
Note: Change to:
UseMysql <-------------- When using Pompelo EntityFrameworkCore

Related

How can I add PostgreSQL to an existing Entity Framework 6 project while keeping the existing SQL Server provider intact?

Disclaimer: I'm a junior dev and still trying to wrap my head around EF6.
Our team has a .NET Framework 4.7 / Entity Framework 6 project which relies on MS SQL Server for its data. We just upgraded to Visual Studio 2022 but it seems like some of the recommended tools don't work on VS2022. We use database first for EF.
Recently, our team decided to add a create a new PostgreSQL database and we need to add support for it in our existing project.
I've installed the following packages:
Npgsql
EntityFramework6.Npgsql
I was advised to also install the following VS extension:
Npgsql PostgreSQL Integration
But it seems like it is only compatible up to VS2019 and has been abandoned.
In order to test if I could even set this up at all with the recommended VS extension, I used Visual Studio 2019 instead of 2022.
After installing the items listed above, my web.config file now has this entityFramework config:
<entityFramework>
<defaultConnectionFactory type="Npgsql.NpgsqlConnectionFactory, EntityFramework6.Npgsql" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, EntityFramework6.Npgsql" />
</providers>
</entityFramework>
and this system.data config:
<system.data>
<DbProviderFactories>
<remove invariant="Npgsql" />
<add name="Npgsql Provider" invariant="Npgsql" description=".NET Framework Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory, Npgsql, Version=4.1.3.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
</DbProviderFactories>
</system.data>
At this point, I attempted creating a new ADO.NET Entity Data Model, I was able to choose the table and procedure I wanted.
This is where I got stuck.
A new connectionString was added to my web.config, alongside the encrypted connectionString we were already using for SQL Server. When testing, it throws an exception saying that I cannot have an unencrypted connectionString next to an encrypted connectionString.
I tried placing the connectionString within the code but then it throws errors when parsing the connectionString, saying that it does not recognize the parameters. I used the same parameters from the connectionString that was automatically generated.
So, it seems like it's reading the Postgres connectionString with the SQL Server provider instead of the PostgreSQL provider.
Any suggestions? Or resources I can use to help me along the way? Thanks in advance.

Inheritance security rules violated by type: 'MySql.Data.Entity.MySqlEFConfiguration'

I've created an asp.net web application which should connect to a mysql database.
I´m using entity framework 6 with an ado.net entity data model. I´ve also followed the following tutorial: https://dev.mysql.com/doc/connectors/en/connector-net-entityframework60.html#connector-net-ef6-config
However calling: DbConfiguration.SetConfiguration(new MySqlEFConfiguration());
causes my application to crash. It probably has nothing to do with this specific method, because creating a DBContext also crashes the app.
Any ideas what's causing this error?
.NET Framework: 4.6.1
MySql.Data.Entity.EF6: 6.10.4
Web.config:
<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="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<providers>
<provider invariantName="MySql.Data.MySqlClient"
type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6"/>
<provider invariantName="System.Data.SqlClient"
type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
</providers>
</entityFramework>
<connectionStrings><add name="DatabaseEntities" connectionString="metadata=res://*/Database.Model.csdl|res://*/Database.Model.ssdl|res://*/Database.Model.msl;provider=MySql.Data.MySqlClient;provider connection string=""" providerName="System.Data.EntityClient" /></connectionStrings><system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add description=".Net Framework Data Provider for MySQL" invariant="MySql.Data.MySqlClient" name="MySQL Data Provider" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.10.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
Complete error:
Inheritance security rules violated by type:
'MySql.Data.Entity.MySqlEFConfiguration'. Derived types must either
match the security accessibility of the base type or be less
accessible.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace
for more information about the error and where it originated in the
code.
Exception Details: System.TypeLoadException: Inheritance security rules violated by type:
'MySql.Data.Entity.MySqlEFConfiguration'. Derived types must either
match the security accessibility of the base type or be less
accessible.
I downgraded MySql.Data.Entity.EF6 to an older version and it solved my problem.
Downgrade MySql.Data.Entity from version 6.10.x to 6.9.10 can solve the problem. It solved mine
I've had some horrible instability problems with 6.9.10. It also seems like it has has been removed from NuGet. Under heavy load i was getting "database not found errors" sporadically.
Try 6.9.11 instead. That seems stable for me. And its available on NuGet.
I did this and it worked for me
Install latest versions of entityframwork and mysql.data and mysql.data.entity from nuget package manager
Create your model databasefirst autogenerate
Unistall mysql.data.entity and install mysql.data.entity v 6.9.10
just learn how to install or uninstall
I got the same issue after upgrading the MySql NuGet packages from 6.9.8 to 6.10.6 in VS 2017 Community. I followed the accepted answer's instructions and downgrading back to 6.9.x fixed it. Upon futher investigation, Oracle has fixed the bug in the upcoming 6.10.7 release (https://bugs.mysql.com/bug.php?id=89134).
In short, until 6.10.7 is released, downgrade back to 6.9.x! I reverted back using the Nuget package manager and didn't have to change anything else to make it work.
The same for me with VS2017. I used MySql.Data.Entity v6.9.10.
Prior to that I also installed mysql connector for .Net version 6.9.10.
After that I installed the NuGet package for MySql.Data.Entity.
Last step was to modify the web.config accordingly:
connection string,
entity framework and
system.data (be aware that you have to update in the last two the version as well if you take them from mysql website)
Ahh not to forget I added also
DbConfiguration.SetConfiguration(new MySqlEFConfiguration())
in my app start up.
and it finally worked :D
Upgrading nuget package to 6.10.8 fixed this for me

WPF/EF/SQLite The server was not found or was not accessible

I have been pulling my hair for many hours on this. I'm new to C# et .NET so I apologize if this is something trivial.
I'm trying to use WPF with Entity framework + SQLite.
I have managed to connect to the SQLite database by manually doing:
var connection = ConfigurationManager.ConnectionStrings["AccountHelper.Properties.Settings.AccountHelperConnectionString"].ConnectionString;
m_dbConnection = new SQLiteConnection(connection);
executeReader();
I get the following error:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 50 - Local Database Runtime error occurred.
The specified LocalDB instance does not exist.
I really have no clue on how to fix this. It is really frustrating!
EDIT: I answered this with a tutorial to configure everything properly.
So to answer my direct question above, the issue was that TextContext didn't know about the connection string. So if you give the same name to your Context as your string value, it will remove this error message.
That said, the configuration was completely wrong. I managed to make it working. Because I struggle a lot, I will share what I did to have it working.
Step to step guide to configure it
Configuration of a WPF project to work with Entity Framework (ADO.NET) and SQLite
Configuring this can be really tricky, even more if you have tried other methods before. So I advise to completely uninstall any SQLite software you might have installed.
1) Depending on your visual studio version, install sqlite-netFx45-setup-bundle-x86-2012-1.0.93.0.exe or equivalent. You can find it on sqlite.org. Few points:
I know for a fact that the 1.0.98.0 and 1.0.99.0 won't work with visual studio 2012. It works but you get an issue when creating your ADO.NET item in the project.
On this webpage, you can't find the old version, you will have to manually modify the URL to get the version you want.
On this webpage, make sure to select a version that has "This is the only setup package that is capable of installing the design-time components for Visual Studio 2013. " visual studio 2013 or not.
Install the exe and make sure to tick the designer related component during the install.
2) Create a new WPF project. Again, if you use a project you already modified, you might have some config issues. You better start a new project, do the config and once you know how to do it, port it to your project.
3) Install the Entity framework via the nugget manager.
4) Add manually (NOT WITH THE NUGGET MANAGER !!!) the following references that you can find in Assemblies -> Extension:
System.Data.SQLite Core
System.Data.SQLite Designer
System.Data.SQLite for Entity Framework
System.Data.SQLite for LINQ
5) Add a new item to this project -> Data -> ADO.NET blabla. Name it as you wish and create. You will need to create a connection for it. This is where if you don't have a compatible SQLite version, you won't be able to create a SQLite connection.
6) Then make sure your App.config look like the following, you might need to change the provider:
<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>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description="Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
<connectionStrings>
<add name="AccountHelperEntities" connectionString="metadata=res://*/AccountHelperModel.csdl|res://*/AccountHelperModel.ssdl|res://*/AccountHelperModel.msl;provider=System.Data.SQLite;provider connection string='data source="W:\visual studio projects\AccountHelper\AccountHelper\Data\AccountHelper.sqlite3"'" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
7) You are good to go.
You can see the project source code on this link. Check the code from the First commit, it contains everything you need. The other commits are project specific.

Entity Framework with Sybase SQL Anywhere 16 crashes Visual Studio

I am trying to use Entity Framework with Sybase SQL Anywhere 16 and database first. I have successfully integrated SQL Anywhere into Visual Studio over SetupVSPackage. I also have added the correct data provider like this:
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="iAnywhere.Data.SQLAnywhere"
type="iAnywhere.Data.SQLAnywhere.SAProviderServices, iAnywhere.Data.SQLAnywhere.EF6, Version=16.0.0.21274, Culture=neutral, PublicKeyToken=f222fc4333e0d400" />
</providers>
</entityFramework>
But now I have the problem that when I try to add a data model, nothing happens, no files were added. If I start Visual Studio with administration access, it simply crashes.
Did anyone get SQL Anywhere 16 working with Entity Framework 6 database first?
Edit
If I start visual studio with devenv.exe /log , the created log file does not contains any error messages. Even the windows eventlog does not contain any error messages.
Thank you!

Entity Framework 6.1.1 and Npgsql 2.2.3: Compatible Entity Framework database provider could not be found

I am working on a project using EntityFramework 6.1.1 and npgsql 2.2.3 within Visual Studio 2012 Update 4. To do so I installed npgsl using the supplied setup and installed the nuget packages "Npgsql" and "Npgsql for Entity Framework" (and "EntityFramework" itself, of course).
Every thing used to be fine: I could successfully access my database for a while - until at some day everything "blew up".
This is the event history:
Fixing compiler errors after a major code upgrade I encountered these error messages:
"could not load npgsl.EntityFrameworkLegacy assmbly" (I did neither install nor reference this assembly)
A whole bunch of "Metadata file 'xxx' could not be found" errors where 'xxx' referred to all my own project assemblies
I've found possible solutions the "Metadata file" problems - like deleting the .suo file, checking the project build order and so on. None of them fixed the problem. So I deleted
the .edmx file (and thus all automatically generated database access files) from my project. This fixed the "Metadata file" problems - introducing "unresolved symbols" of course.
I tried to add a new "ADO.NET Entity Data Model" to my project to regain database access. Only all PostgreSQL database connections where not listed any more in the connection list.
Also I could not create new PostgreSQL connections because this data source was not listed. Though this did not affect the global "data connections" dialog within
Visual Studio: here I could still access my PostgreSQL connections.
I reinstalled npgsql using the setup. Now I could create a new "ADO.NET Entity Data Model" and connect to my PostgreSQL database. But this time I'm getting the error message:
"Your project references the latest version of Entity Framework; however, and Entity Framework database provider compatible with this version could not be found [...]". This is
where I am stuck now.
My current setup is:
the project refers to the following assemblies:
EntityFramework 6.1.1 for .NET 4.5
EntityFramework.SqlServer 6.1.1 for .NET 4.5
Npgsql 2.2.3 for .NET 4.5
Npgsql.EntityFramework 2.2.3 for .NET 4.5
This is my app.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql.EntityFramework" />
</providers>
</entityFramework>
</configuration>
I have this in my machine.config (both 32bit and 64bit):
<system.data>
<DbProviderFactories>
<add name="Npgsql Data Provider" invariant="Npgsql" description=".Net Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory, Npgsql, Version=2.2.3.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" support="FF" />
</DbProviderFactories>
</system.data>
Of dourse I tried to rebuild my solution before adding the new model. But this didn't help.
Are there any other configuration issues I may have missed?
Anybody who could explain me my why all this happened at all?

Categories