Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

'System.IO.FileLoadException' When accessing NationalInstruments.DAQmx.dll

When I try to access the NationalInstruments.DAQmx.dll assembly (or load an object that does) I get the following exception:

 

A first chance exception of type 'System.IO.FileLoadException' occurred in AxMFX.dll

Additional information: Could not load file or assembly 'NationalInstruments.DAQmx, Version=8.3.20.13, Culture=neutral, PublicKeyToken=4544464cdeaab541' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

 

I have the project (C#) which this is referencing the 8.3 version of DAQmx, but I am deploying the 8.7 version. I am surprised that this is a problem because in the projects properties I have "Specific Version" set to false.

 

Is this a problem with the NI assemblies (they possibily only support specific versioning) or is it a problem with my code?

 

0 Kudos
Message 1 of 5
(6,148 Views)
Hello Tyzack,

This problem could be due to the deployed DAQmx .dll not being in the location your code expects it to be. Check to see if the path to this .dll on the development computer is different from the location on the deployment computer.

Let me know if this is the case.

Regards,
Dan King

0 Kudos
Message 2 of 5
(6,128 Views)

They are both running out of the same path;

\bin\myDaqmx.dll

\bin\NationalInstruments.DAQmx.dll

 

I think that the problem has to do with versioning because when I built myDaqmx.dll with reference to version 8.3, but deploy the merge module for 8.7 (or just install the 8.7 version directly) I see this, but not when I deploy the 8.3 version.

 

I am puzzle because I have the "specific version" property turned off in visual studio.

0 Kudos
Message 3 of 5
(6,124 Views)
Hello Tyzack,

I am continuing to look into this problem. One thing I would like a little more information on is how you deployed the merge module for DAQmx 8.7 when you are developing in DAQmx 8.3?

Seperate from that, have you tried to deploy this program on several computers running DAQmx 8.7, or just a single computer? Have you tried installing on systems with any other versions of DAQmx. A little more information about systems running newer versions would be useful.

Regards,
Dan King

0 Kudos
Message 4 of 5
(6,095 Views)

Dan-

 

 Actually, everything works fine when I change the reference in the project to version 8.7, however, I also see the problem when I change the reference in the project to 8.8, and deploy with 8.7. It would seem as though you have to reference and install the same version, even if you have specific version set to false.

 

 I have the merge module for 8.7 because when I started working on a different project that also used NI, I downloaded that for the install.

 

 I then inherited this current project from a colleague who had starting working on it about a year and a half ago, against version 8.3 In order to try to isolate the project, he first added a reference to the 8.3 drivers he had on his system, with the copy local flag set. He then built the project and removed the original reference and added a local path reference to the files that had just been copied over locally.

 

 I now have the installation "working" by not using the merge module, but by installing the files that are built with the project (version 8.3, or whatever version the project is built against).

 

 The version of the DAQmx drivers on the target computers does not seem to matter, we have a mix on our test PCs, between 8.6, 8.7, and 8.8. If 8.9 is out, we will start using that.

0 Kudos
Message 5 of 5
(6,090 Views)