Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

System.IO.fileloadException: Could not load file or assembly NationalInstruments.Common, Version=13.0.40.188 The located assembly's manifest definition does not match the assembly reference.

I have referenced in my Project version 13.0.40.190 but it keeps looking for the slightly older version after I build it and run it on another machine. I put the version 13.0.40.190 in my application root also.

0 Kudos
Message 1 of 37
(9,515 Views)

I would make certain that the same version NI-VISA is installed and that both PCs have same .NET Framework version installed.

0 Kudos
Message 2 of 37
(9,497 Views)

Hello,

 

What version of Visual Studio are you using to build and deploy your application? What version of the .NET Framework are you using?

Please take a look at the suggestions in this forum post and also this forum post about the same error. They discussions have to do with using the WiX installer for Visual Studio 2012. They basically point out that all National Instruments DLL's and Assemblies must be installed in the GAC, and there is information in these forums about how to do this with the WiX installer example.

 

There is also a KnowledgeBase article with useful information about deploying with the WiX installer: Deploying Measurement Studio Applications with WiX

Taylor B.
National Instruments
0 Kudos
Message 3 of 37
(9,492 Views)

I using Visual Studio 2010 C# 

 

This is an application that runs off a thumb drive. Which was working perfectly fine until I upgraded my measurement studio. The only thing I am using from Measurement Studio is the LED Control, Waveform Graph and Plots, and the Tank control.

 

 

0 Kudos
Message 4 of 37
(9,479 Views)

To add to this I added the following code to put all the dlls in the GAC.

Publish AddDlltoGac = new Publish();
AddDlltoGac.GacInstall("NationalInstruments.UI.WindowsForms.dll");
AddDlltoGac.GacInstall("NationalInstruments.UI.dll");
AddDlltoGac.GacInstall("NationalInstruments.Common.dll");
AddDlltoGac.GacInstall("NationalInstruments.Common.Native.dll");

 

Then ran the application on a seperate computer and it did in fact copy the correct Dlls to the GAC version 13.0.40.190

BUT I still received the exception stating it's looking for the 13.0.40.188..

0 Kudos
Message 5 of 37
(9,477 Views)

Hello,

 

Are you able to confirm that NationalInstruments.Common 13.0.40.190 did register successfully in the GAC of the target computer? Are you using any other drivers (e.d. NI-DAQmx, NI-VISA, etc.)?

 

Please also check that your build configuration is not set to AnyCPU, as this can cause trouble when the application seraches for assemblies, as detailed in KB 341AEOW3: Deploying Measurement Studio Applications in Microsoft Visual Studio 2010 and Earlier. This KnowledgeBase article also serves as a good reference for deploying Measurement Studio applications.

 

You mentioend you upgraded the version of Measurement Studio. What were version were you using before and what version are you using now? You can check the Measurement Studio Release Notes for changes between versions.

 

0 Kudos
Message 6 of 37
(9,473 Views)

I just wanted to clarify that was me posting above ^^
I accidentally had logged into a different account for trouble shooting purposes.

Taylor B.
National Instruments
0 Kudos
Message 7 of 37
(9,471 Views)

Yes I verified they were installing in the GAC.

 

No other drivers needed.

 

Last version I was using was:

NationalInstruments.Common 8.1.20.415

NationalInstruments.Common.Native 8.1.20.415

NationalInstruments.UI 8.1.20.472

NationalInstruments.UI.Windowsforms 8.1.20.472

 

 

0 Kudos
Message 8 of 37
(9,469 Views)

Ok, that rules ou ta few problems. Here's some more ideas:

 

  1. On the development and target machines, what do you see in: C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NationalInstruments.Common?
  2. I saw yet another forum with this error. Please see the solution, and see if it helps.
  3. Also, I saw a suggestion to use strong assembly names when registering the assembly in the GAC.
    The basic structure of a strong-named assembly is as follows: 
    NationalInstruments.Common, Version=13.0.35.190, Culture=neutral, PublicKeyToken=4544464cdeaab541, processorArchitecture=MSIL 

    You can find these strong names for your assemblies by going to the command prompt (search for cmd in the Windows Start menu). First, change the current directory of the command prompt to the folder containing gacutil.exe using a command similar to the following (the path may be different on your computer): 
    cd C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools 

    Then use the following command to generate a list of all assemblies in the GAC: 
    Gacutil -l >myLog.txt 

    Then open up the generated myLog.txt file. It will contain the strong names for every assembly in your GAC. Search for the ones of interest and make sure that you are using the correct version (you may have several versions of the same assembly installed on your machine if you have multiple versions of Measurement Studio installed). 

Hope this helps

Taylor B.
National Instruments
0 Kudos
Message 10 of 37
(9,461 Views)