Last modified: Sep 18, 2023

Breaking changes

Overview over breaking changes introduced in App Nuget-packages in v6.0.0.

Altinn.App.* libraries target .Net 6 now, which requires that the application does the same.

In addition, all references to app and platform services have been moved from Startup.cs and should be replaced with two method calls.

Follow the instructions below to ensure that the app is compatible with version 6 of the Altinn.App.* packages.

  1. Update target framework and package dependencies

    Install .Net 6 SDK before you start changing code.

    Navigate to you application repository and find App.csproj in the App folder.

    Update target framework to .Net 6 by replacing

    <TargetFramework>net5.0</TargetFramework>
    

    with

    <TargetFramework>net6.0</TargetFramework>
    

    In the same file, update the Altinn.App.* package references to version 6.0.0.

    <PackageReference Include="Altinn.App.Api" Version="6.0.0">
      <CopyToOutputDirectory>lib\$(TargetFramework)\*.xml</CopyToOutputDirectory>
    </PackageReference>
    <PackageReference Include="Altinn.App.Common" Version="6.0.0" />
    <PackageReference Include="Altinn.App.PlatformServices" Version="6.0.0" />
    
  2. Update Dockerfile to use .Net 6 images

    The Dockerfile can be found in the root folder of the application repository.

    Update build image by replacing

    FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build
    

    with

    FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build
    

    And update the runtime image by replacing

    FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine AS final
    

    with

    FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS final
    
  3. Update program.cs
    The structure of program.cs has changed for dot net 6. Copy code from this file .

  4. Add custom service references
    If you have already added custom services and other changes to startup.cs and program.cs you need to add it to program.vs

  5. Delete startup.cs
    This is no longer needed