Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

C# 9.6 Could not load file or assembly 'NationalInstruments.DAQmx Error

I have built a C# program that measures current through a current monitor + NI USB-6008. I have a separate library for the NI stuff and added references to NationalInstruments.Common.dll and NationalInstruments.DAQmx.dll. The way I added them was to copy them to my library folder and then Right-Click References folder > Add Reference... > Select the dll from the folder. Is this the proper way or is there some other way to add the dll?

 

When running the program, I get the following error:

System.IO.FileNotFoundException: Could not load file or assembly 'NationalInstruments.DAQmx, Version=9.6.45.292, Culture=neutral, PublicKeyToken=4febd62461bf11a4' or one of its dependencies. The system cannot find the file specified.
File name: 'NationalInstruments.DAQmx, Version=9.6.45.292, Culture=neutral, PublicKeyToken=4febd62461bf11a4'

 even though the dll is included. The steps I have tried are:

1. Made the project Platform Target: x86

2. Previously I had DAQmx 9.9 installed. I removed it and installed 9.6.1

 

What else can I do as I have been working on this for 2 days now and nothing is working?

0 Kudos
Message 1 of 9
(6,710 Views)

 

You link to the NI DLLs in the directory to which they were originally installed..

0 Kudos
Message 2 of 9
(6,690 Views)
So what would be the directory location of the 9.6.1 driver on windows 7 machine?
0 Kudos
Message 3 of 9
(6,685 Views)

@Musent wrote:
So what would be the directory location of the 9.6.1 driver on windows 7 machine?

Just un-install and re-install to get it right. And don't mess with it afterwards.

 

0 Kudos
Message 4 of 9
(6,680 Views)
But after I install the driver, I need to add it to my project in visual studio. Where is theveryone location for the dll that I need to add a reference to?
0 Kudos
Message 5 of 9
(6,676 Views)

On Windows 8.1 laptop with .NET 4.0 installed, C:\Program Files (x86)\National Instruments\MeasurementStudioVS2010\DotNET\Assemblies\Current

0 Kudos
Message 6 of 9
(6,673 Views)
OK I'll try that out. Thank you for the help and I'll report back.
0 Kudos
Message 7 of 9
(6,671 Views)

@nyc_(is_out_of_here) wrote:

On Windows 8.1 laptop with .NET 4.0 installed, C:\Program Files (x86)\National Instruments\MeasurementStudioVS2010\DotNET\Assemblies\Current


I checked here and there are no DAQmx.dll files in this directory. Where would I find the dll for the DAQmx?

0 Kudos
Message 8 of 9
(6,636 Views)

Finally got it working on my machine by uninstalling the 9.6.1 version and installing 9.9 version. Added the DLL to my project from C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current and added the same DLL to my build server. 

 

Now, on another computer with DAQmx 9.9 or 14.0, it gives the same error as the original post. Why would it work on mine and not another computer?

 

0 Kudos
Message 9 of 9
(6,629 Views)