02-08-2012 03:15 PM
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!
Solved! Go to Solution.
02-09-2012 02:41 PM
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.
02-09-2012 03:05 PM
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.
12-20-2012 04:05 AM
Thanks very much!
I suffer the issue as well, changed "Any CUP" to "X86" is a very good idea, thanks!