12-08-2009 01:18 PM
Well I've gotten a headache and my eyes are crossing trying to resolve a problem we are having here with trying to use a .NET assembly from within a LabVIEW 8.6.1 built EXE. The .NET assembly is instantiated, originally in a sub-vi that then passed out the reference, but I've moved it to the highest level vi that is in this program. In either instance it worked when the program was run in the development environment, but when I make it into a EXE I get the following error message (this is when the instantiation is in the highest level vi) when I click on the resulting EXE:
Error 1172 occurred at Error creating instance of CI2CCOMMSInterface in assembly Comco.CI2CCOMMSInterface, I2CCOMMSInterface, Version=1.1.3614.19528, Culture=neutral, PublicKeyToken=null, (System.IO.FileNotFoundException: Could not load file or assembly 'ModuleManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
) in Update Board Cal Constants v2.vi
I've tried manually moving the dll from the "data" folder in the build directory, to the same directory as the exe, even tried putting it in the directory ..\shared\LabVIEW Run-time\8.6, thinking that the definition of "calling program" might be stricter than "calling exe". To no avail. I haven't been able to talk to the original author of the .NET assembly, not certain what to ask him so I'm open for suggestions.
Thanks again,
Solved! Go to Solution.
12-08-2009 02:19 PM
Hi Putnam:
Did you include the dll in your project? Also for the build, did you add it to Source Files, Always Included? Does the dll depend on any other files, i.e. a config file?
-AK2DM
12-09-2009 08:30 AM
It was included in build, as well as my copying it manually to the directory where the .exe resides (the build puts it in the ..\data subdirectory)
I also have manually put it in the ..\LabVIEW 8.6 directory, next to the LabVIEW.exe, in the ..\Shared\LabVIEW Run-time\8.6 directory where the run-time engine's "stuff" goes, to address the comment in another post that it needed to be near the calling program, as mentioned below. No joy. This is an area in which I am not as knowledgeable as some others, have "played" with .NET very little. I'm going to try to get in touch with the author of the .NET code, but am even a little ignorant of what questions to ask him, or what information sources to point too.
12-09-2009 10:08 AM
Putnam:
You may want to try downloading and running debugview while executing your application. It may provide more details as to what specifically is creating the error.
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
I see your user icon is comprised of just three lower bytes (trilobite). 🙂 Sorry, couldn't resist.
-AK2DM
12-09-2009 10:22 AM
Thanks AnKid. The three lower bytes is an indirect reference to my exalted age, feeling at the moment "older than dirt", in fact having served on the committee that came up with the name "dirt".
I will give that a try, see if its whining will give us a little more info on what it doesn't like. Apparently, from my searching, 1172 isn't too descriptive.
12-09-2009 11:51 AM
Ok, it is only my third day on a new job! I downloaded the debugview and it gave me a little more information, but in looking at how it worked, trying to get an understanding of its various messages (Symantec's programmers apparently left the debug message flag to true in this version of anti-virus!) I realized that something AnalogKid... said jiggled some brain-bits (in the lower three bytes!).and that error message was telling me what was wrong. The ModuleManager reference turns out to be to another inhouse produced dll (I was thinking, for some reason, that it was part of the overall .NET environment, when I thought about it!), that wasn't in either the project or in the dependecies. Apparently the "CI2COMM" dll references it, but LabVIEW doesn't know that so I had to add it to the project manually, then direct the build to put it adjacent to the .exe's destination. Seems to work, no errors when the exe launched, will run it against hardware (about 1/2 mile of building away, unless I want to trek through the new snow, then only a 1/4 mile)
Thanks for the brain jogging. In much of my work this is the only "peer" encounter that I get. This new job has a bunch of brainiacs and some LabVIEWers (may be brainiacs too) so it is a change.