From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy a .NET app with NI dlls?

Solved!
Go to solution

Hello all,

 

I hope I have the right place here.

 

I have a .NET utility I wrote in C# in Visual Studio 13 which I'd like to make freely available.  It uses the NationalInstruments.Common and NationalInstruments.NI4882 dlls to directly read a GPIB instrument.  I have LabView installed and it runs fine on my development system, but when I publish my app and try to install and run on another machine I get an unhandled exception error:

"System.TypeInitializationException: The type initializer for 'NationalInstruments.NI4882.Internal.GpibDll' threw an exception. ---> System.DllNotFoundException: The NI-488.2 Driver library cannot be found.  Either Gpib is not installed, or Gpib is improperly installed. ---> System.DllNotFoundException: Unable to load DLL 'ni4882.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

 

Am I publishing my app incorrectly, or is it not possible to include the NI dlls along with it?  Are the dlls proprietary, so they'll only work if a person has LabView or equivalent installed?

 

Thanks for any help,

Gerrit

0 Kudos
Message 1 of 6
(5,599 Views)
Just like on your development computer, you have to actually install the NI-488 driver. It is not part of your .NET build. If you are using the recommended VISA api, that has to be installed as well, though there is a smaller runtime only version that you can use. Any instrument driver that you distribute should be compliant with the IVI standard so there might be additional dependencies as well.
0 Kudos
Message 2 of 6
(5,595 Views)

Thanks, Dennis.  Can I rely on my app working on someone's computer regardless of how they've installed their NI-488 driver, or is there something I need to do to be able to find it on a given machine?  Will my app only look for it in the folder where it exists on my machine, for example?

 

Gerrit

0 Kudos
Message 3 of 6
(5,574 Views)
The driver should be installed to the default Windows folder. The installation process also includes a validation that the driver is installed correctly. Didn't you install the driver on your pc?
0 Kudos
Message 4 of 6
(5,568 Views)
Solution
Accepted by topic author CarpeCimex

Yes, I installed the driver on my PC along with LabView, but I don't want users of my utility to be required to have LabView.

 

I found that you can download and install official NI-488-2 drivers at no charge from here, as long as you don't specify to install support for LabView, etc.  If you just specify .NET and/or C/C++ support it installs drivers without requiring registration.  So this is a good solution -- even non LabView users can get GPIB drivers from NI and use them with my utility.

0 Kudos
Message 5 of 6
(5,538 Views)
That is exactly the same thing you did originally except you probably installed the driver from a dvd. The installation of NI-488 has always been free and always separate from LabVIEW.
0 Kudos
Message 6 of 6
(5,534 Views)