10.2   .NET Development Environments

Chapter “Creating Applications With HALCON/.NET” emphasized the platform-independence of .NET applications. However, applications still depend on their target .NET runtime environment and for GUI applications, the corresponding implementations for, e.g., Windows Forms or WPF.

There are two main environments, .NET Framework 2.0-4.8 and .NET Core 3.1, with the next version being named .NET 5. Generally, these dependencies are backwards compatible within a branch, e.g., an application targeting .NET Framework 2.0 should run with all newer .NET Framework versions. It should still be possible to open a project file for Visual Studio 2005 with Visual Studio 2019 as well.

Table 10.1 indicates the minimum requirements and capabilities of the different HALCON/.NET interface variants.


Development Environment HALCON/.NET Interface Minimum Runtime Environment Windows Forms WPF Linux Support

Visual Studio 2005 %HALCONROOT%\bin\dotnet20 .NET Framework 2.0 Yes No Mono

Visual Studio 2008 / 2010a %HALCONROOT%\bin\dotnet35 .NET Framework 3.5 Yes Yes Mono (no WPF)

.NET Core 3.1 SDK (Windows)b MVTec.HalconDotNet (NuGet Package)
MVTec.HalconDotNet-Windows (NuGet Package)
.NET Standard 2.0
.NET Core 3.1
No
Yes
No
Yes
Yes
No

.NET Core 3.1 SDK (Linux) MVTec.HalconDotNet (NuGet Package) .NET Standard 2.0 No No Yes

a WPF support was still rudimentary in Visual Studio 2008 with limited designer support.
b If you want to use Visual Studio you will need at least version 2019.

Table 10.1: Properties of different HALCON/.NET interface variants.

The examples provided generally target the oldest supported environment. For example, Windows Forms applications target .NET Framework 2.0 and are shipped with Visual Studio 2005 versions that open in all newer versions of Visual Studio. WPF applications target .NET Framework 3.5, typically with Visual Studio 2008 or Visual Studio 2010 projects.

The non-WPF C# examples also come with makefiles to support building via command line both with .NET Framework under Windows or Mono under Linux. Source files are placed in a separate, shared source directory next to the project or makefile directories. Some dedicated .NET Core examples are provided, which are suitable for building via command line using the .NET Core SDK.