Managing Versions of .NET to Use with TestStand

The .NET Adapter uses .NET 8 to call assemblies. The TestStand Sequence Editor and the example .NET user interfaces target .NET Framework 4.0.

Managing Versions of .NET to Use with TestStand 2023 Q4 and Earlier

In TestStand 2023 Q4 and earlier, the .NET Adapter uses the .NET Framework Common Language Runtime (CLR) version 4.0 to call assemblies, and the TestStand Sequence Editor and the example .NET user interfaces target .NET Framework 4.0.

By default, an application that uses the .NET Framework Common Language Runtime (CLR) 4.0 cannot load an assembly written in C++/CLI and built against an earlier .NET Framework version. However, you can create an application configuration file to direct the .NET Framework to allow an application to load such an assembly. Place the application configuration file in the same directory as the executable and use a filename with the same name as the executable and append a .config extension.
Note   An application configuration file is needed only for C++/CLI assemblies that are built against earlier versions of the .NET Framework CLR. Assemblies created in C# or VB.NET Framework, for example, can be loaded by default, even if the assemblies are built against an earlier version of the .NET Framework CLR.

For example, to specify that the sequence editor can load legacy C++/CLI assemblies, create in the <TestStand>\Bin directory a file named seqedit.exe.config that contains the following information:

<?xml version="1.0"?>

<configuration>

<startup useLegacyV2RuntimeActivationPolicy="true">

<supportedRuntime version="v4.0" />

</startup>

</configuration>

When you set the useLegacyV2RuntimeActivationPolicy="true" attribute to true, you force an application that uses the .NET Framework CLR 4.0 to load all legacy assemblies in the .NET Framework CLR 4.0, including legacy C++/CLI assemblies, but you also disable the ability to run multiple versions of the .NET Framework CLR in-process and side-by-side. Refer to Microsoft MSDN documentation for more information about using this configuration option.