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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET DLL BadImageFormatException

I'm trying to load Sensor64.dll on my Thinkpad T530 to access accelerometer data. I've looked at previous threads suggesting I set up my LabVIEW.exe.config file to load .NET assemblies from a specific version, example here:

http://digital.ni.com/public.nsf/allkb/32B0BA28A72AA87D8625782600737DE9?OpenDocument
http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/configuring_clr_version/

I still get the same error.

Here's my config file contents:

 

<?xml version ="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0.30319"/>
  </startup>
  <runtime>
    <loadFromRemoteSources enabled="true" />
  </runtime>
</configuration>

It's the same for both 32 bit and 64 bit LabVIEW 2013. Any ideas?

0 Kudos
Message 1 of 4
(3,090 Views)

Hey there.

 

So your assembly is a 4.0 .NET assembly correct? Do you know if there are any features in the assemblies you're loading that are not supported? See link below for more information.

 

Which .NET Features Are Not Supported in LabVIEW?

http://digital.ni.com/public.nsf/websearch/DC41DCDA972642CF8625787E00732DDD

 

I've also found some mention that the BadImageFormatException can occur if using DLL's whose bitness does not match the OS. Do you know if the DLL itself is 32 or 64 bit? What about your OS?

Eden K
Applications Engineer
0 Kudos
Message 2 of 4
(3,045 Views)

It is a 4.0 assembly. I don't believe any of the unsupported features are in it, but I could be wrong. The DLL is within system32, but is called Sensor64, so I'm not sure whether it's 32 or 64 bit. My OS is Windows 10 64 bit.

0 Kudos
Message 3 of 4
(3,040 Views)

If you can find out what type of DLL it is that could be helpful. Unfortunately I haven't found much other mention of this exception aside from those causes, but I'll keep looking.

Eden K
Applications Engineer
0 Kudos
Message 4 of 4
(2,999 Views)