Today I was getting some assembly mismatch issue and after a bit of digging I found that for a particular DLL, actual reference in project was made to some other version and
config file for that project was showing dependency to some other version of the same DLL.
Exp.
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" />
<bindingRedirect oldVersion="2.0.1.4000" newVersion="2.1.2.4000" />
</dependentAssembly>
I removed the dependency declaration for that assembly from the config file and voila! I was able to run again :-)
My question is -
When are <dependentAssembly>
declarations made in the project config file? Do we add them manually? And in what scenario?
When are
<dependentAssembly>
declarations made in the project config file? Do we add them manually? And in what scenario?
When you want to ensure the software binds to a newer version of an assembly at runtime than that which it was built against.
More info: http://msdn.microsoft.com/en-us/library/7wd6ex19.aspx
Can you please also guide in what scenario we need older version at compile time and newer version at run-time?
For example, if you are using a vendor API, the vendor may have identified a bug and needs to issue a new version but you've already shipped.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With