10-27-2014
01:05 PM
- last edited on
09-18-2026
04:03 PM
by
Content Cleaner
I built an application to measure current consumption from a device in Visual Studio 2012. I built a library for the National Instruments USB-6008 and added the dll from C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current, which is 9.9. Everything ran smoothly on my dev machine so I pushed all changes to the production server, which is packaged as a Click-Once app.
On the machine running the actual Click-Once app, I downloaded and installed the driver fir 9.9 from here: https://www.ni.com/en/support/downloads/drivers/download.ni-daq-mx.html#288377. When the application gets to the point where it measures the current consumption, I get the error:
System.BadImageFormatException: Could not load file or assembly 'NationalInstruments.DAQmx, Version=9.9.45.39, Culture=neutral, PublicKeyToken=4febd62461bf11a4' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'NationalInstruments.DAQmx, Version=9.9.45.39, Culture=neutral, PublicKeyToken=4febd62461bf11a4'
What am I doing wrong?
Solved! Go to Solution.
10-28-2014
10:27 AM
- last edited on
09-18-2026
04:03 PM
by
Content Cleaner
Hi Musent,
Unfortunately, ClickOnce deployment is not supported with Measurement Studio or any National Instruments .NET components, including any NI drivers. The following knowledge base article documents this pretty well.
http://digital.ni.com/public.nsf/allkb/148A815DF9379F8786257560005DB06A?OpenDocument
If you read through that and check out the links at the bottom, it suggests using a windows installer and installing these components separately.
11-06-2014 09:33 AM
The solution I found for this problem was to install the Examples for Measurement Studio. Not sure why this needs to be installed on the machine running the Clickk-Once App though.