How to Enable Long Path Support of .NET Framework in LabVIEW

Updated Jul 5, 2022

Environment

Software

  • LabVIEW

Programming Language

  • C# .NET

The .NET Framework long path support is not enabled by default in LabVIEW, however, it is possible to enable it by following a few extra steps.

To force LabVIEW to recognize the long path support function of the .NET Framework, open a text editor and create a configuration file with the following syntax:

<?xml version="1.0" encoding="utf-8"?> 
<configuration>
<startup>

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
<runtime>
<AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" />
<
/runtime>
</configuration>


Save the configuration file as labview.exe.config on your hard drive in the same location as LabVIEW.exe. The next time you launch LabVIEW. Do note that when building an executable from the LabVIEW project, you will have to include a <executable name>.exe.config file next to the executable.