11-20-2014 11:00 AM
Hello Experts!
I am trying to import a .dll that I have created using visual studio 2010 sp1 (using c++) into labview. (lets say the super basic example described here:
Walkthrough: Creating and Using a Dynamic Link Library (C++)
Everything works fine when I am trying to do things in visual studio, I am even able to import the .dll in other .net applications. However, when I try to import this .dll into LabView, I get this error:
System.BadImageFormatException:
Could not load file or assembly 'C:\....\yourFile.dll' or one of its dependencies.
the module was expected to contain an assembly manifest. (Pls see attached screen shot.)
I know right of the bat that I have to check my visual studio settings. I have done so, I have followed the steps described in below threads carefully and made sure that the manifest is embedded in the .dll.
http://stackoverflow.com/questions/12853502/manifest-for-my-own-native-dll
http://msdn.microsoft.com/en-us/library/ms235229%28v=vs.100%29.aspx
and here which describes how to embed it in a post process: http://msdn.microsoft.com/en-us/library/ms235591.aspx
http://msdn.microsoft.com/en-us/library/aa375649%28v=vs.85%29.aspx
However, I keep getting the same error when importing this .dll into LabView.
The thing is that I have developed tons of other .dlls in .net (all in C#) and never had any problem like this. So, defintely there is something obvious that I am missing! I would be happy if you could please help me with this?
Solved! Go to Solution.
11-20-2014 11:48 AM
By the way, the target .Net Framework version of the .dll is .net2.0
11-20-2014 12:27 PM
redesigning the .dll as managed assembly solved this issue.