Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find the requested .Net Framework Data Provider in Visual Studio 2010 Professional

Why am I getting "Unable to find the requested .Net Framework Data Provider" when trying to setup a new datasource in Visual Studio 2010 Professional?

My stats:

  • Windows 7 64bit 16gig RAM
  • Visual Studio 2010 Professional
  • SQL Server 2008 (server A, full admin rights)
  • SQL Server 2008 (server B, full admin rights)

I have started a test ASP.NET application and when I try to add a new data source, I get:

Unable to find the requested .Net Framework Data Provider. It may not be installed.

I have .NET 4 installed.

When I build the connection and click "Test Connection" it tests successful. SQL Server Management Studio connects just fine and I have verified the credentials on everything.

like image 833
cbmeeks Avatar asked Mar 29 '12 15:03

cbmeeks


3 Answers

I have seen reports of people having and additional, self terminating node in the machine.config file. Removing it resolved their issue. machine.config is found in \Windows\Microsoft.net\Framework\vXXXX\Config. You could have a multitude of config files based on how many versions of the framework are installed, including 32 and 64 bit variants.

<system.data>
    <DbProviderFactories>
        <add name="Odbc Data Provider" invariant="System.Data.Odbc" ... />
        <add name="OleDb Data Provider" invariant="System.Data.OleDb" ... />
        <add name="OracleClient Data Provider" invariant="System.Data ... />
        <add name="SqlClient Data Provider" invariant="System.Data ... />
        <add name="IBM DB2 for i .NET Provider" invariant="IBM.Data ... />
        <add name="Microsoft SQL Server Compact Data Provider" ... />     
    </DbProviderFactories>

    <DbProviderFactories/>  //remove this one!
</system.data>
like image 54
Mike Avatar answered Nov 15 '22 17:11

Mike


I like the other suggestions but I would rather not update the machine.config for a single application. I suggest that you just add it to the web.config / app.config. Here is what I needed to use the MySql Connector/NET that I "bin" deployed.

<system.data>
    <DbProviderFactories >
        <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
</system.data>
like image 40
Bobby Cannon Avatar answered Nov 15 '22 16:11

Bobby Cannon


It works for me thank you. I had this issue when I installed .Net Framework 4.7.1, somehow DbProviderFactories settings under System.Data in machine config got wiped-out. It started working after adding the necessary configuration settings as shown below DataProviderFactories

<system.data>
    <DbProviderFactories>
      <add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
      <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
    </DbProviderFactories>
</system.data>
like image 6
Vijay Avatar answered Nov 15 '22 16:11

Vijay