Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Could not load file or assembly 'NationalInstruments.VisaNS, Version=8.9.20.108

Solved!
Go to solution

I've a VS C# application that references the NI VisaNS assembly.  It has been working fine in the WindowsXP 32bit environment.  However, when I installed and ran the app in the Windows 7 64bit environment.  The app would flag the following:

 

System.IO.FileNotFoundException: Could not load file or assembly 'NationalInstruments.VisaNS, Version=8.9.20.108, Culture=neutral, PublicKeyToken=4544464cdeaab541' or one of its dependencies. The system cannot find the file specified.
File name: 'NationalInstruments.VisaNS, Version=8.9.20.108, Culture=neutral, PublicKeyToken=4544464cdeaab541'

 

Where do I find this assembly version file and why didn't it ask for it when I ran it in the 32bit WindowsXP platform?  It's the same app binary.

 

Thanks for your help!

0 Kudos
Message 1 of 4
(10,361 Views)

When distributing your application to a new system, there are two important things you need to do for your drivers. 1) Install the assembly and dependent assemblies to the target. This is usually done in the app installer through the merge module. More information on this can be found in the Measurement Studio topic on Distributing Measurement Studio Applications. 2) Install the driver to the target. This usually has to take place separately because most installers frameworks do not allow you to include the driver installer in the app installer. You likely are missing the underlying driver DLLs and resource files that are installed with the driver installer. You can find the driver installer on the Driver DVD or you can download it from www.ni.com/drivers.

National Instruments
0 Kudos
Message 2 of 4
(10,355 Views)
Solution
Accepted by topic author kphung

Another reason you may be getting this error is if you have your target platform set to "Any CPU" in the project properties. The "Any CPU" setting will cause the application to run in 32-bit mode on a 32-bit system and 64-bit mode on a 64-bit system. This would be a problem or a 64-bit system because you do not have the 64-bit assemblies installed and a 64-bit app cannot load a 32-bit assembly. You should change this setting to "x86" which will force it to run in 32-bit mode on both 32-bit and 64-bit systems.

National Instruments
Message 3 of 4
(10,351 Views)

Thanks very much!

I suffer the issue as well, changed "Any CUP" to "X86" is a very good idea, thanks!Smiley LOL

0 Kudos
Message 4 of 4
(10,006 Views)