08-26-2019 01:21 PM
Hello,
I am using packed project liobrary that references WinSCP dll located in
C:\Program Files(x86)\WinSCP\WinSCP.dll
when I build library LabVIEW makes copy of this dll to destination folder of the build.
This is fine for me but then this error is displayed when I open compiled library:
Why this happens?
Is there a way to tell LV to leave this dll in the same place?
10-02-2019 08:35 AM - edited 10-02-2019 08:36 AM
That's uncanny! I had exactly the same issue with the same DLL only a few days ago and spent ages trying to figure it out, until I stumbled across the following thread:
https://forums.ni.com/t5/LabVIEW/NET-Assembly-in-Packed-Library-Bizarre-Behavior/td-p/3815758
Basically, it's a known bug in LabVIEW (CAR #720595). If the .NET reference is stored in the class's private data it doesn't adjust the links to the PPL DLL.
To workaround this, store the reference as a common .NET class (e.g. System.Object) inside the class data and then use accessors to type cast it back to the WinSCP class.