By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,182 Members | 1,548 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,182 IT Pros & Developers. It's quick & easy.

Error: "Column 'InvariantName' is constrained to be unique. Value 'MySql.Data.MySqlClient' is already present."

P: n/a
Hi,
I am using ASP.Net 2.0 with the MySQL Connector .Net 5.1.2.2.
I added these lines to the web.config to make the connector.net able to
handle the SqlConnection object (and so to bind it to a grinview/formview
etc.):

<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=5.1.2.2, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
</DbProviderFactories>

The application works perfectly in local when I test it through Visual
Studio 2005.
But, on the web site, I get this error:

Column 'InvariantName' is constrained to be unique. Value
'MySql.Data.MySqlClient' is already present.

It's probably due to the fact that a previous version of the MySql
Connector.net is installed in the GAC of the web server... but I want to use
the binary located in the /Bin directory of my application.

How can I solve this problem?

Thanks in advance,
Carmine
Nov 30 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Nobody?

Furthermore, here is the machine.config:

<system.data>
<DbProviderFactories>
<add name="Odbc Data Provider" invariant="System.Data.Odbc"
description=".Net Framework Data Provider for Odbc"
type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OleDb Data Provider" invariant="System.Data.OleDb"
description=".Net Framework Data Provider for OleDb"
type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OracleClient Data Provider"
invariant="System.Data.OracleClient" description=".Net Framework Data
Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory ,
System.Data.OracleClient, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" />
<add name="SqlClient Data Provider" invariant="System.Data.SqlClient"
description=".Net Framework Data Provider for SqlServer"
type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data,
Version=5.1.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data,
Version=5.0.8.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>

As I see, there are two same invariant name, one for the 5.1.3.0 version of
MySQL and one for the 5.0.8.1.
How can I remove an invariant name from my application with no edit of the
machine.config?

Dec 1 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.