Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remap assembly version

Switching from debug to release build causes the Visa device to stop working and the following cryptic warning:

Target ResolveAssemblyReferences:

Consider app.config remapping of assembly "Ivi.Visa.Interop, Culture=neutral, PublicKeyToken=a128c98f1d7717c1" from Version "3.0.0.0" [] to Version "3.2.0.0" [dll\Ivi.Visa.Interop.dll] to solve conflict and get rid of warning. C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3247: Found conflicts between different versions of the same dependent assembly.

The Ivi.Visa.Interop reference properties in the VS2008 project indicate that the dll is Version 3.2.0.0. What is the procedure to remap assembly version as suggested by the warning?

like image 394
jacknad Avatar asked Aug 24 '11 12:08

jacknad


2 Answers

The situation I had, was with:

{Final Class Library}<-{Dependent Class Library}<-{Referenced DLL}

The {Referenced DLL} had multiple GAC PublicKeyToken matches.

So the {Final Class Library} compilation ignored the version referenced in the {Dependent Class Library} and used the highest Version= value. This had output with No way to resolve conflict between and Choosing ... arbitrarily etc.

Instead of assembly binding, I just added a reference in the {Final Class Library} to the {Referenced DLL}. I'm happier with this option, it seems simpler.

like image 187
user326608 Avatar answered Nov 18 '22 04:11

user326608


The warning "Found conflicts between different versions of the same dependent assembly." implies that you have multiple assemblies in your project referencing different COM Interop stubs - I'd suggest choosing one (assuming there is no primary interop assembly provided by the library vendor) and changing all references to reference that interop assembly (rather than adding references to the COM library all over the place)

like image 28
Rowland Shaw Avatar answered Nov 18 '22 04:11

Rowland Shaw