views:

150

answers:

2

Hi I started building apps with this technology and I am facing a weird problem... on some machines I need to add theese lines to the app.config to get to work:

  <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.3.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>

while in other machines it runs well without theese lines.... the thing is that when I add theese lines the app wont run on machines that did not needed theese lines in the firs place, and I would like not to publish to versions of the app, is there a way to solve this?

Any Help would be appreciated!!!

+3  A: 

Would post as comment but i can't yet.**

It could be your machine.configs are different. I would check to make sure your DbProviderFactories are registered consistently in the machine.config.

Nix
+1 Perfectly fine suggestion as an answer if you ask me.
Simon P Stevens
just read your last comment, then your user name... as part of the comment. Too funny...
kervin
can you please expand your answer to Instructions on how to do what you suggest?
Luiscencio
Did you check your configs? C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Machine.Config ? Make sure they are consistant? And did you see my post below?
Nix
you did not see my other comments??? you do not deserve the bounty and yet you are getting it.... sad =(
Luiscencio
What is the problem? Which comment are you talking about?
Nix
forget it.. there you go free rep!!!
Luiscencio
A: 

Did you try removing it?

<system.data>
   <DbProviderFactories>
      <remove invariant="MySql.Data.MySqlClient"/>
      <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.3.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>
Nix