From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I resolve conflict between versions?

Solved!
Go to solution

HI all,

 

I have an application using the NI VISA drivers.  Recently, I have updated the MAX and the NI 488.2 drivers (as I am using GPIB) and since them I get the following warning when I build the application:

 

No way to resolve conflict between "NationalInstruments.Common.Native, Version=9.1.40.159, Culture=neutral, PublicKeyToken=dc6ad606294fc298" and "NationalInstruments.Common.Native, Version=9.0.40.362, Culture=neutral, PublicKeyToken=dc6ad606294fc298". Choosing "NationalInstruments.Common.Native, Version=9.1.40.159, Culture=neutral, PublicKeyToken=dc6ad606294fc298" arbitrarily.

No way to resolve conflict between "NationalInstruments.NiLmClientDLL, Version=9.1.40.159, Culture=neutral, PublicKeyToken=dc6ad606294fc298" and "NationalInstruments.NiLmClientDLL, Version=9.0.40.362, Culture=neutral, PublicKeyToken=dc6ad606294fc298". Choosing "NationalInstruments.NiLmClientDLL, Version=9.1.40.159, Culture=neutral, PublicKeyToken=dc6ad606294fc298" arbitrarily.

Consider app.config remapping of assembly "NationalInstruments.Common.Native, Culture=neutral, PublicKeyToken=dc6ad606294fc298" from Version "9.0.40.362" [] to Version "9.1.40.159" [C:\Program Files\National Instruments\MeasurementStudioVS2010\DotNET\Assemblies\Current\NationalInstruments.Common.Native.dll] to solve conflict and get rid of warning.

Consider app.config remapping of assembly "NationalInstruments.NiLmClientDLL, Culture=neutral, PublicKeyToken=dc6ad606294fc298" from Version "9.0.40.362" [C:\Windows\Microsoft.Net\assembly\GAC_MSIL\NationalInstruments.NiLmClientDLL\v4.0_9.0.40.362__dc6ad606294fc298\NationalInstruments.NiLmClientDLL.dll] to Version "9.1.40.159" [C:\Program Files\National Instruments\MeasurementStudioVS2010\DotNET\Assemblies\Current\NationalInstruments.NiLmClientDLL.dll] to solve conflict and get rid of warning.

Consider app.config remapping of assembly "NationalInstruments.Common, Culture=neutral, PublicKeyToken=dc6ad606294fc298" from Version "9.0.40.362" [C:\Windows\Microsoft.Net\assembly\GAC_MSIL\NationalInstruments.Common\v4.0_9.0.40.362__dc6ad606294fc298\NationalInstruments.Common.dll] to Version "9.1.40.159" [C:\Program Files\National Instruments\MeasurementStudioVS2010\DotNET\Assemblies\Current\NationalInstruments.Common.dll] to solve conflict and get rid of warning.

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3247: Found conflicts between different versions of the same dependent assembly.

 

 

The app.config is basically empty - just the .Net framework SKU is given there.

 

How do I get rid of these issues?

 

 

Thanks,

Ben

0 Kudos
Message 1 of 5
(15,053 Views)

Hi everyone,

 

I guess, I should add that I am also using NationalInstruments.VisaNS version 9.0.40.156.

Moreover, I have modified my app.config file (see below). This way, I got rid of the warnings.

 

However, I am not too happy about this workaround and I would like to understand where this is comming from and how I can really get rid of the problem (not only the warnings).

 

Right now I have installed on my computer NI 488.2 version 3.0.2 and MAX version 5.2.0. I assume that's the root cause of the problem...

 

Ben 

0 Kudos
Message 2 of 5
(15,048 Views)
Solution
Accepted by schwabe111

Hi Ben,

 

The app.config file actually is the correct solution. What is happening is that you have a higher version of NationalInstruments.Common.dll on your system than some of your application's dependencies such at VisaNS were built against. This is by design though. NationalInstruments.Common.dll is forward compatible, so your application will run just fine with a higher version of Common (this is why the messages are warnings and not errors). The reason it was designed this way is because Common is a component of all National Instruments .NET libraries. It contains some common functionality that is universal to all of our libraries. However, each library is built against a particular version of Common. In many cases this leads to a scenario where you may be using two libraries, such as VisaNS and DAQmx, that are built against different versions of Common. In this case, you can build your application using the higher version of Common and everything will run ok because it is forward compatible.

 

What the app.config file is saying is for you application to run using the higher version. It is stating that any dependencies that require Common version 9.0.40.362 should use 9.1.40.159 instead. You need this because you are building your application against this version since some other component require this higher version (in some cases this may also be because this is the version installed on your development system but none of your dependencies require it). That way when you run the application, the dependencies will look for the 9.1.40.159 version rather than the 9.0.40.362 version (your application can only load one version of an assembly). This is important when running on systems that may have many versions.

 

I don't know if you manually created the app.config file or not, but if you double-click the warning in Visual Studio, it will automatically generate the app.config file for you.

National Instruments
Message 3 of 5
(15,042 Views)

Hi D_Biel,

 

Thank you for explaining it in this great detail!

 

Ben

0 Kudos
Message 4 of 5
(15,039 Views)

"it will automatically generate the app.config file for you."

This is not happening. It it were, I would not spend my time here. And probably also the other hundreds thousands people that have checked this page. Why don't you solve it once and for all?

 

0 Kudos
Message 5 of 5
(2,683 Views)