Migrating an existing API program to .NET 8

Here is an overview how to migrate your API programs to .NET 8

Migrate projects

  1. Use our DevKit Tools plugin to create a new, empty API project using exactly the same name (Namespace) as your existing plugin.

    Create Api Program Menu
    Create Api Program

    The create API program entry is only available within a multi-user project.

    Using this project template generator, the project will already come with th Articy.API NuGet package containing all required articy files and custom MSBuild targets for an API program.

      Note

    The files articy:draft 3 supplied with an own installer are now part of the NuGet package.

    Please keep in mind that starting with articy:draft X all code is 64-Bit only.

    The NuGet package comes with additional dependencies matching those of our used 3rd Party libraries

  2. Copy all your (source) files from the existing one into the new project folder. Visual Studio will pick up all files automatically

  3. Edit your Properties\AssemblyInfo.cs file and remove all assembly versioning related entries. You can specify them in the "Packaging/General" section of your projects properties or add them manually directly into the global "PropertyGroup" of the project file. This looks something like:

    AssemblyInfo settings
    <AssemblyTitle>MyCompany.MyProgram</AssemblyTitle>
    <Company>Articy Software GmbH &amp; Co. KG</Company>
    <Product>MyProduct</Product>
    <Copyright>Copyright © 2024</Copyright>

  4. Check/set all your custom resource files/images and set the "Copy To Output Directory" and "Build Action" settings as required

  5. Use the NuGet Package Manager to add possible depenencies. Keep in mind that .NET 8 needs at least the availability of .NET Standard 2.0 ones.

  6. Now a recompilation should work. Check if your dependencies are properly copied to the output directory ...\bin\Debug\net8.0-windows\win-x64

    If you don't see them there you should check your project file for the following setting in the global PropertyGroup

    Copy Dependencies to output
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

  7. If your plugin uses Windows Forms edit your project file and add the following lines to the global PropertyGroup.

    Adding Windows Forms
    <UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
    <UseWindowsForms>true</UseWindowsForms>

  8. As part of the migration to .NET 8 we also updated some of our libaries. While updating JSON.NET should not impact your code, our used Excel Library ClosedXML had some API changes. Those should be easily fixed. For a guide take a look at the ClosedXML migration guide here: ClosedXML - Migration from 0.97 to 0.100