I have a project which using Microsoft.SqlServer.SMO.dll, which is always copying to bin directory (CopyLocal is set to true).
However, there may be installed different versions of SQL SMO. Thay have the same assembly version (10.0.0.0), but different file versions (10.0.1600.22 and 10.50.2500.0). The end user may have installed the older version of assembly to GAC, but I need to load always 10.50 from bin.
So, I have the following situation:
Bin -> 10.50.2500.0
GAC -> 10.0.1600.22
When my app is running, the assembly from GAC is loaded, and from bin is ignored.
How can I prevent such behaviour? Many thanks.
You can provide your own manifest for the application to tell it that you want to use the ‘bin’ location explicitly. It’s a medium sized topic, but this a good link that will get you started.
http://msdn.microsoft.com/en-us/library/1w45z383.aspx