From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

If my VI used .NET, what do I need to bundle into my installer

Hi,

 

I've been using LabVIEW for many years, but I am new to .NET.

 

I would like to use some basic .NET functions in my application (using LabVIEW 2020).  The application will be compiled into an EXE and distributed to customers through an installer (using LabVIEW Application Builder). 

 

My question is:  What  do I need to include in my installer to ensure my .NET functions will work properly on the target machine?   

http://www.medicollector.com
0 Kudos
Message 1 of 5
(699 Views)

There is nothing specific from a LabVIEW perspective (the runtime handles the COM CLR hosting) but you may need to add additional installers from outside LabVIEW. Depends on what .NET assemblies you are using.

 

  • If you are only using assemblies from the Framework itself, then the client only needs the "same" version of .NET Framework (or higher if 4.x). Depending on the OS, you may not even need an installer at all but I'd suggest including one anyway since that might be outside your control. You can download offline installers from Microsoft.
  • If you are using assemblies from another source (from a vendor or similar) then you need to include those assemblies and/or any installers that came with that package you used to develop with.
0 Kudos
Message 2 of 5
(668 Views)

Thank you.  This was helpful.  I had a couple follow up questions:

 

  • Is there a way to programmatically detect which version (if any) of .NET framework is installed?  Without crashing?  I am guessing I could make a basic .NET call and see if it fails, but am concerned it might crash if .NET is not installed.

  • According to this page and the readme for LV 2020SP1 (which I'm using), it appears that .NET framework 4.6.2 gets installed when LV RTE is installed.  Can someone confirm this is true?  The readme says:

 

      2 NI software installs VC2015 Runtime and .NET 4.6.2 

 

So if I write my code using .NET Framework 4.6.2, due to the backward compatibility of the framework, I can certain that it will run on my target machine ... because the LV RTE install will install 4.6.2 (if a >= version is not already present).  Not sure how I'd test this, though.  Would have to find a fresh Windows computer without .NET framework installed.  

http://www.medicollector.com
0 Kudos
Message 3 of 5
(647 Views)

I suspect your second question resolves the first. I think your information is correct, the LabVIEW run-time does have a dependency on a minimum version of .NET (could be 4.6.2) as it needs that to access the CLR COM components. It also has a few of its own tools targeting the framework. So you can be sure that a minimum version already exists if you have the run-time. To be doubly sure of this, you could try installing into a fresh VM.

 

In addition; this link might be useful in case you have need check installation version: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-ar...

0 Kudos
Message 4 of 5
(619 Views)

And unless you try to install into a very ancient version of pre-Windows 7, .Net will be for sure already present anyways. Many standard Windows tools require that too.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(609 Views)