04-06-2023 09:10 AM
Hello,
when insert a -NET Constructor and click on it then i can select a file in the object list or use the Browse button to locate it.
Is there a way to pass the path of the dll intro constructor?
Something like an input parameter of the constructor where i can pass a string constant conaining the path.
Thanks
04-07-2023 05:25 PM - edited 04-07-2023 05:29 PM
04-07-2023 05:44 PM
Raphschru is correct that you can't do this. I believe that it's because .NET has much stricter typing than traditional DLLs (usually a good thing...).
Maybe if you tell us why you feel you need to do this there will be an alternate solution.
04-07-2023 06:24 PM
As the others said, you cannot specify the path, but you could try the following below and keep all your .NET dlls in a specific folder. It works for the .NET libraries that Thorlabs ships.
04-08-2023 08:12 AM - edited 04-08-2023 08:14 AM
.Net assemblies are never supposed to be loaded from the current directory. That would be a major security concern for .Net. So your Thorlabs DLLs are likely normal binary DLLs that the Thorlabs .Net interface calls through .Net Interop or Platform Invoke.
For binary DLLs the current directory is one of the directories that is searched unless security options for the current user prevent that. But use of the current directory is a brittle solution. A number of things can affect it, including the Windows file selection dialog which will change it to the directory that it was in when you close it affirmative for a file or directory selection!
04-08-2023 03:13 PM - edited 04-08-2023 03:16 PM
Hello,
the reason why i want to do this is because of a problem in TestStand when running a teststep that contains a DotNet constructor. The error code is the same as if the DLL is totaly not available.
The DLL works fine in Labview
The teststep calling the DLL works fine in Teststand with Development-adapter
The teststep calling the DLL works fine in Teststand with Runtime-adapter
A custom GUI calling Teststand-API and executing the above works fine with LV-development-adapter configured in TS
==> BUT NOT WORKING any more with custom GUI when changing in Teststand to LV-runtime adapter (error -17600)
So my idea was to give a hardcoded fix path to the constructor if the problem is that the runtime cannot find the DLL.
What else can i try to find the reason of this problem?
Thanks for all help
This is the thread to the problem in the teststand-forum (no answers yet) also with some screenshots.