LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

use .net controls without having all dlls in the same directory of the labview project ?

Hello,

 

I am developping an application in Labview 2020 in which among various devices, I have several Thorlabs axes controlled using Kinesis .net control. The issue I'd like to solve is that it seems all dlls have to be located in the same directory where my labview project is located, which is not very nice for the end-user but otherwise Labview is not able to load the .net control.

 

Is there any way to use .net controls without having all dlls in the same directory of the labview project ?

 

Thanks a lot in advance

0 Kudos
Message 1 of 2
(760 Views)

I assume when you refer to "application" you are talking about a series of VIs loaded into the Dev environment as opposed to a stand-alone executable? If so, then as far as I know you really only have a few 'easy' options

 

  1. Keep the dependencies in the project path (as you are currently doing) so that LabVIEW's default search locations are added to the probing paths. It can be a sub-folder in the project folder.
  2. Push common assemblies into the GAC. They have to be signed to do this so if the vendor has not signed the assemblies then this is a no-go.
  3. Use a config file for the application hosting the .NET CLR to specify alternate probing paths (see https://docs.microsoft.com/en-us/dotnet/framework/deployment/how-the-runtime-locates-assemblies). In your case, the application hosting the CLR is the LabVIEW Development environment, so the file is LabVIEW.exe.config. This is still a minor hassle for your end users to use.
  4. You could try merging all the assemblies into a single "combined" assembly. ILMerge is the tool I have used previously for a task similar to this but I can't be sure if LabVIEW will be happy with the result (https://github.com/dotnet/ILMerge)

There are some 'not-easy' solutions that are complicated a bit by the fact that you are hosting a .NET Control-derived type on the Front Panel (I assume this is what you meant by 'control'). They primarily rely on the .NET Reflection API.

0 Kudos
Message 2 of 2
(715 Views)