Bug #67867 Unable to Add Connection in VS2010 (Connector NET)
Submitted: 10 Dec 2012 21:33 Modified: 2 Feb 2013 1:18
Reporter: richard cohen Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:6.6.4 OS:Windows
Assigned to: CPU Architecture:Any
Tags: Add connection, connector net, Visual Studio, vs2010

[10 Dec 2012 21:33] richard cohen
Description:
When I try to add a connection in VS2010, I can choose the MySQL data source, but when the Add Connection windows appears and I try to type anything, the window closes without error. If I try hitting the spacebar on the window instead, I get the error "Object Reference not set to instance of an object." and then the window closes. If I don't try to type anything but just click 'ok' instead, I get the error: "Unable to find the request .NET Framework Provider. It may not be installed."

I have verified that the MySQL Connector NET is shown as installed on the VS2010 About page. I have verified that the DLLs are in the Windows\Assembly. The activity log in Visual Studio shows no errors. 

Successfully loaded extension...
          C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Oracle\MySQL Connector Net\6.6.4\   Extension Manager 2012/12/10 21:18:19.776 
103  Extension is enabled...
          C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Oracle\MySQL Connector Net\6.6.4\   Extension Manager 2012/12/10 21:18:19.777 
Successfully loaded component assembly from cache
          C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Oracle\MySQL Connector Net\6.6.4\MySql.VisualStudio.dll   Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost 2012/12/10 21:18:19.856
Begin package load [MySQL Connector Net 6.4.4] {79A115C9-B133-4891-9E7B-242509DAD272}  VisualStudio 2012/12/10 21:18:24.300 
218  End package load [MySQL Connector Net 6.4.4] {79A115C9-B133-4891-9E7B-242509DAD272}  VisualStudio 2012/12/10 21:18:24.337 

This problem has been replicated several times on fresh installs of both VS2010 and the MySQL Connector NET 6.6.4. (Visual Studio 2010 SP1 is installed).

How to repeat:
1. In Visual Studio 2010, in the Server Explorer, click Connect to Database
2. Highlight MySQL Database and click Continue (verify .NET Framework Provider for MySQL is the selected Data Provider).
3. The Add Connection window appears. Try to type anything into any of the text fields.
4. The window closes without an error.
[23 Jan 2013 19:01] Fernando Gonzalez.Sanchez
That seems strange, there have been reports of it before, but clear how to repro.

Any information you can provide (whether if you have previous Connectors installed, other apps running while installing 6.6.4, or the msi log could help).
[23 Jan 2013 19:12] richard cohen
I resolved the problem, it was in the machine.config file. There was an additional self-closing <DbProviderFactories />. I had to remove that entry, and now my config file looks like this:

'''
		<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.5.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
			<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
    </DbProviderFactories>
'''

Now it works fine.
[2 Feb 2013 1:18] Fernando Gonzalez.Sanchez
Ok, good to know you solved your problem.

We were not able to reproduce it installing Cnet 6.6.4 in VS2010.

If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.