Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Correct reference to VisaNS

We are using the VisaNS .NET 2.0 assembly from a C# class library using VisualStudio 2005.
 
What is the correct way to reference the VisaNS and Common assemblys?
 
The examples in the MeasurementStudioVS2005 folder references the assemblies in C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Assemblies\Current\NationalInstruments.VisaNS.dll
 
I see two problems with this:
1) The VisaNS.dll is only installed in this location if the development support is selected when installing VISA. The dll will not be installed on non development machines.
 
2) There will be versioning issues. The development and production machines must use exactly the same VISA revision or are backward compatibility solved with binding Redirect or similar?
 
I see too alternatives:
 
1) Include the VisaNS.dll with the application and reference to the included dll. Will an older VisaNS dll work with newer VISA isntallations? Should the Common.dll also be included.
 
2) Reference the VisaNS.dll registrated in the GAC. For unknown reasons on some machines the VisaNS is not registred in the GAC. When new versions of VISA is installed, will all old revisions also be installed or are backward compatibility solved with binding Redirect or similar?
 
Regards
Hans Forssell

0 Kudos
Message 1 of 2
(4,490 Views)
The Measurement Studio help includes a couple of topics that should provide some insight into these questions. You can access the Measurement Studio help if a variety of ways, one of which is through Start>>All Programs>>National Instruments>>Measurement Studio 8.1 for Visual Studio 2005>>Measurement Studio Help.
 
 
(These hyperlinks will work only if you have the help installed on the machine on which you click them).
 
To answer your questions/issues more directly:
1) The VisaNS.dll is only installed in this location if the development support is selected when installing VISA. The dll will not be installed on non development machines.
You need to deploy NationalInstruments.VisaNS.dll to the production machines along with your application that uses it. You can either create an installer to do this or use XCOPY deployment. If you create an installer, you should use the merge modules that NI supplies to deploy the VisaNS assembly. You can choose to deploy the VisaNS assembly to the GAC or to the application directory.
 
2) There will be versioning issues. The development and production machines must use exactly the same VISA revision or are backward compatibility solved with binding Redirect or similar?
VisaNS.dll does not use a binding redirect (policy file). If you deploy NationalInstruments.VisaNS.dll along with your application, there will not be any versioning issues. There are no versioning issues between the version of NationalInstruments.VisaNS.dll and the underlying NI-VISA driver DLL because the driver DLL guarantees backward compatibility.
NationalInstruments.Common.dll uses a policy file and guarantees backward compatibility.
 
So, I am basically saying that you should go with your option 1 on the development machine and you can choose where the application loads VisaNS.dll from on the deployment machine.
0 Kudos
Message 2 of 2
(4,478 Views)