08-14-2014 10:05 AM
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?
08-15-2014 02:49 PM
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?
08-16-2014 01:45 AM
08-16-2014 01:22 PM
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.
08-17-2014 03:51 PM
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).
08-17-2014 05:06 PM
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
08-18-2014 08:50 AM
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....
08-19-2014 02:15 PM
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.