Creating Applications for various versions of the .NET Framework

Creating Applications for various versions of the .NET Framework

You are here:
< Back

This KB explains how to target different versions of the .NET Framework when creating applications with Visual Studio, VB .NET or C# .NET. This issue applies to the Windows Forms Barcode Control.

Solution(s):

IDAutomation .NET barcode components and compiled applications can target different versions of the .NET Framework. To ensure the correct version of the framework is used in Visual Studio, select the “target framework” option in the Application section of the solution. It is also recommended to create a .config file with the same name as the .exe file and specify the CLR version(s) of the framework that are compatible with the .exe file, listed in order of preference. For example:

EXE File Name: MyApp.exe
Config File Name: MyApp.exe.config

Contents of the .config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<startup>
	<supportedRuntime version="v2.0.50727"/>
	<supportedRuntime version="v4.0"/>
	</startup>
</configuration>

Note that “v2.0.50727” is the CLR used in the .NET Framework 2.0, 3.0, and 3.5. Details regarding this can be found at:
https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-configure-an-app-to-support-net-framework-4-or-4-5