Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

VB.Net 2013 Dev. Env. Could not load file or assembly 'NationalInstruments.Common, The located assembly's manifest definition does not match the assembly reference

Solved!
Go to solution

Hi,

When attempting to connect to a GPIB device in VB.Net, an exception is thrown:
System.IO.FileLoadException: Could not load file or assembly 'NationalInstruments.Common, Version=13.0.40.168, Culture=neutral, PublicKeyToken=dc6ad606294fc298' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This is in VB 2013, on Windows 10.
The same exception is reported on two different development PCs. On both PCs, I have loaded NI from a CD and connected a USB/GPIB adapter. I tried the same adapter on both PCs as I only have the one. From both PCs, I can communicate with the GPIB instrument using the NI-VISA Interactive Control.

Here is what I have tried:
Creating references to the NI dlls in my project, then clean and rebuild
Deleting project binary files (then clean and rebuild)
Changing the reference to NationalInstruments.Common.dll in the .vbproj file
Rebooting the PC
Searching C:\ for all locations of NationalInstruments.Common.dll. None of the dlls are 13.0.40.168 (The PC has 15.0.40.49154 which our company uses, and 8.7.35.131 a previously used version)
Checked the various GAC files for anything with 13.0.40.168

Does anyone know where this reference to 13.0.40.168 comes from? Or have any suggestion as how to resolve this?

Thanks

0 Kudos
Message 1 of 3
(2,541 Views)

I seem to recall something about having to change the Target Framework to something without Client Profile.

0 Kudos
Message 2 of 3
(2,424 Views)
Solution
Accepted by topic author Jeff_TE

I solved it by adding this to the primary project's app.config file:

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="NationalInstruments.Common" publicKeyToken="dc6ad606294fc298" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-15.0.40.49154" newVersion="15.0.40.49154" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

 

0 Kudos
Message 3 of 3
(2,393 Views)