Migrating User Interfaces to .NET Core
- Updated2025-07-23
- 1 minute(s) read
Migrating User Interfaces to .NET Core
Consider the following when migrating custom user interfaces to .NET Core:
- Ensure that your custom UI applications work correctly on high-DPI monitors by
making them DPI-unaware. Follow the below methods to disable DPI awareness for
your UI in different programming languages:
- For custom UIs developed in C#, make your application DPI-unaware by
calling the Application.SetHighDpiMode method with the
HighDpiMode.DpiUnaware parameter before running the
application in your main method, like in the following
example:
[STAThread] private static void Main(string[] args) { // Set the application to be DPI-unaware Application.SetHighDpiMode(HighDpiMode.DpiUnaware); // Your application initialization code here } - For custom UIs created with other programming languages, you can make them DPI-unaware by
setting the dpiAware flag to
False in the application’s manifest
file.
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</dpiAware>
- For custom UIs developed in C#, make your application DPI-unaware by
calling the Application.SetHighDpiMode method with the
HighDpiMode.DpiUnaware parameter before running the
application in your main method, like in the following
example:
- Update the .csproj file or the runtime configuration file
for your custom user interface to depend on
Microsoft.NETCore.App,
Microsoft.WindowsDesktop.App, and
Microsoft.AspNetCore.App. You can use the below format to
include dependencies on these .NET
runtimes.
<ItemGroup> <FrameworkReference Include="Microsoft.WindowsDesktop.App" /> <FrameworkReference Include="Microsoft.AspNetCore.App" /> </ItemGroup>
- If you want to run LabVIEW with .NET in your custom UI, create a token file
named <ApplicationName>.ini next to your application
which includes the following
content:
[LVRT] DisableDotNetFrameworkSupport=True
Note This file must be created for any TestStand application that uses LabVIEW. - For .NET applications, set the EnableUnsafeBinaryFormatterSerialization
property to true in the .csproj
file.
<PropertyGroup> <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization> </PropertyGroup>
Related Information
- Calling LabVIEW VIs That Invoke .NET Code in TestStand
TestStand applications like the TestStand Sequence Editor and TestStand C# User Interfaces are .NET Core processes in TestStand 2025 Q2 and later.