LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building .NET assembly with LabVIEW (2011) - output fails with error 1172

Hi,

 

I'm trying to build a LabVIEW VI into a .NET library, to be called by another program (running in Java as it happens). The build process goes ok, no errors reported, but when I attempt to call the resultant library with a LabVIEW test VI I get the following error:

 

Error 1172:

 

Error calling static method TestLibrary.TestLibrary_Class.startSession, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
    Inner Exception: System.IO.FileNotFoundException: Missing Dependency in:
    Inner Exception: NationalInstruments.LabVIEW.Interop.VIAssemblyException: Missing Dependency in: ) <append><b>NationalInstruments.LabVIEW.Interop.VIAssemblyException</b> in Library_Tester.vi

 

This is also reported by the Java test program - so not particular to the LabVIEW test. I've attached the example I put together - any ideas/comments/solutions much appreciated, totally stuck!

Cheers

Pete

0 Kudos
Message 1 of 6
(2,805 Views)

Pete,

 

the error states something of a missing dependency. What dependencies does your interop assembly have? Are you sure that those are available to your test bed?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 6
(2,802 Views)

Hi Norbert,

 

That's the strange thing - I probably should've clarified in original post - the assembly should have no real dependencies (other than the default LabVIEW libraries) since it just takes an integer and increments it by 1 using the LabVIEW function. No toolkits or ext. dependencies called.

 

Pete

0 Kudos
Message 3 of 6
(2,781 Views)

Pete,

 

i tried to reproduce the error using you intial attachement, but it gives me an error during loading. What version of LV did you use to build the .NET assembly? What .NET framework version are you using for it?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(2,776 Views)

Hi Norbert,

 

I'm using LV2011 to build the library. .NET version - hmm, not sure, but running Windows 7 64bit with LV 32bit.

 

cheers

Pete

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

I am using LV 2012. Still i get a very unusual error stating:

System.BadImageFormatException.

Reason: The assembly was build using a newer version of runtime than currently loaded.

 

This seems rather odd.... nevertheless, after recompiling the assembly and rebinding the constructor node, everything works as expected.

Therefore, i guess you have a corrupt assembly. You should recreate it in some other folder.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 6
(2,769 Views)