LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET dll calls and directory reqts

When Labview calls a C# .NET dll method, does the dll have to be in the same directory as the calling VI for some reason? If so what do you do if the called dll will not function in this directory what are the solutions?

0 Kudos
Message 1 of 8
(2,810 Views)

I dont think they need to be in the same directory, how are you using the dll in LabVIEW? I believe that the .NET constructor node allows you to browse to the dll regardless of location. Can you give a snippet of code and explain more about the dll and your end goal?

Patrick H | National Instruments | Software Engineer
0 Kudos
Message 2 of 8
(2,766 Views)
Yes, you can browse to DLL locations. If the DLL you call isn't located in the standard Windows location for DLLs, in the build LV will include it in a "data" subdirectory to the installation directory.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 8
(2,755 Views)

Labview apparently makes use if NET Share copying and this may be the problem.  The code in the dll must be able to execute when there is a shared copy of it running in memory. Labview copies the dll to another dir to execute it and if the methods are not capable of running from that new dir, or they have interrelations with other files that are not funcitoning due to this, there may be grief.  I am continuining to investigate this by inserting specific nonshadowing operations into the Labview.ini and running Microsoft's process explorer utility to determine how this thing behaves.  If you have any insights, please let me know.

0 Kudos
Message 4 of 8
(2,743 Views)

LabVIEW does use shdow copying to move it dlls into an isolated storage location.

 

My guess is that the dll you have has other dependencies (not in memory) and thus the CLR can't find the dll via normal search methods (since it is not in the same isoltaed storage location or in the LabVIEW project folder - you are using LabVIEW projects, right?).

 

My advice is to either locate the extras to the GAC (making sure they are signed of course) or ILMerge them (or use a LabVIEW project if you aren't already).

0 Kudos
Message 5 of 8
(2,722 Views)

Thanks but Labview does use shadow copying as shown in http://forums.ni.com/t5/LabVIEW/LabVIEW-NET-and-the-GAC-walk-into-a-bar/m-p/520360/highlight/true#M2...

You can turn it off by pasting into the Labview.ini file and that works as I have done it as part of this troubleshooting path.

 

Thanks for the info on the GAC

 

0 Kudos
Message 6 of 8
(2,712 Views)

I am not using a labview project but a standalone VI just trying to get this thing working.  The VI is saved in a differnt dir than the dll.  The dll path is added to teh VI Search paths....

0 Kudos
Message 7 of 8
(2,692 Views)

I presume you have read this:

 

http://digital.ni.com/public.nsf/allkb/C4EA5ABBEB67AF7C862573F3004D4421

 

You should use a LabVIEW project. You other 'dependency' dlls will be found automatically irrespective of where the single dll is moveed to isolated storage.

0 Kudos
Message 8 of 8
(2,668 Views)