04-12-2022 01:26 AM
Hi! I'm working on a LabVIEW application which has some .NET dependencies. It should communicate via HTTPS connection with another server, but the version of the .NET Framework doesn't support TLS 1.2 protocol by default, so I have added a configuration file to manipulate the .Net framework behavior:
<?xml version ="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<AppContextSwitchOverrides value="Switch.System.Net.DontEnableSystemDefaultTlsVersions=false"/>
</runtime>
</configuration>
My LabVIEW project name is Trados Autmation.lvproj so I named the config to Trados Automation.lvproj.config and placed them in the same folder. I did this process with the execution file too: tat.exe and tat.exe.config. The interesting part is that this solution works with the execution file, but doesn't work with the lvproj file. It seems to not recognize this config. May I miss something? Or what is the reason why it works this way, and another way not?
Solved! Go to Solution.
04-12-2022 10:43 AM
Could you explain "not recognized" in more detail? Thanks.
04-12-2022 09:20 PM
I don't claim to be an expert in this, but I was successful in creating a Project that had a Config folder, where I put "Configuration data", and built an Executable that was identified as indicated in the Build Specs. Here are two entries in the Build Spec:
In the Project, I had a Virtual Folder (Config) that "mirrored" a Physical Folder (Config). Inside were two text files, a .ini file and a text file that had information I wanted to read/write during the execution of the Program. I had a sub-VI called "UTIL Config Folder" that returned the folder, both in the Project (when running in Development Mode) and in the Executable (which was in a sub-folder called "Config") when running the Executable.
The "green" VI is "Create Dir if Non-existent" from OpenG (installed using VIPM).
Whenever I need to read or write a file in this folder, I use the above Config Folder VI to get the "Folder" and add the File Name string and do a "Build Path". During Development, this picks up files that "live" in the Project's Config Folder, but when I deploy and run the Executable, the same code pulls the specified File from the Config Folder that gets built into the Config sub-folder inside the Folder created as part of the Build process.
Bob Schor
04-28-2022 07:17 AM
I use Fiddler to catch the HTTPS request from my LabVIEW application. When I run the tat.exe (which is executable from the project), the exe recognizes the tat.exe.config and it uses TLS 1.2 when it send a HTTPS request:
When I want to run the main.vi from the LabVIEW Project, HTTPS request uses still the TLS 1.0 version:
So I think the project can't find the project config file. The files look like this:
The config files' contents are the same. I don't know why this config doesn't work with the project. Do you have any idea?
04-28-2022 07:28 AM
04-28-2022 07:31 AM
Have you tried to make a config for LabVIEW.exe ?
(Remember to place it next to the exe in program file folder)
04-28-2022 07:48 AM
Hi,
I don't have a problem with the exe.config file. It works well. The problem was with the lvproj config, but I have tried your idea with the project file, but unfortunately, it doesn't work.
Best Regards,
Eniko
04-28-2022 07:49 AM - edited 04-28-2022 07:50 AM
No, I didn't try it earlier, but it works! Thank you very much!
04-28-2022 11:12 AM
If you run the project from the IDE you have to create a LabVIEW.exe.config in the directory of your LabVIEW.exe. If you have build an Executable, you need a <Name of your App.exe>.config in the directory of your Executable.