views:

163

answers:

2

I'm getting an error like this in an application,

Could not load file or assembly 'MySql.Data, Version=6.2.2.0, Culture=neutral,PublicKeyToken=c5687fc889699c44d' or one of its depedencies. The located assembly's manifest defenition does not match the assembly reference.

Which is expected, as this installation happened to have a previous version of the .dll installed.

Can I tell(in Vs2008) to link to this MySQL.data.dll and not care about its version ? The MYSQL.data.dll reference within the project has a property named "Specific Version", although setting it to false yields no difference.

I'm well aware of the implication if this .dll is binary incompatible with the one required.

A: 

Yes, you can. Select the referenced dll, and in the property windows set 'specific version' to False.

Benny
As I mentioned, I've done that to no avail.
Anonym
A: 

SpecificVersion can't solve your problem, that only works at compile time. You ought to rebuild your program for a minimum of surprises. Or you can use the <bindingRedirect> element in the .exe.config file.

Hans Passant
I'm aware of the surprises that can occur. The question is more general. I'm about to build some assemblies of my own and I want to be able to upgrade those .dlls individually without rebuilding the .exe that reference them
Anonym
Don't change the [AssemblyVersion] if it is just a bug fix that doesn't change the public interface of the classes. Only update the [AssemblyFileVersion]. The .NET 3.5 assemblies are still at 2.0.0.0 for example. The fact that MySql changed the version is a strong hint that recompiling is required.
Hans Passant