ActiveReports 16 .NET Edition
ActiveReports 16 User Guide / Upgrade Reports / Migrate .NET Framework Project to .NET Core 3.1/.NET 5/.NET 6 Platform
In This Topic
    Migrate .NET Framework Project to .NET Core 3.1/.NET 5/.NET 6 Platform
    In This Topic

    An existing ActiveReports application can be migrated from .NET 3.1 or .NET 5 to .NET 6 by following these simple steps provided on MSDN page. To migrate ActiveReports application to .NET 6, you need Visual Studio 2022 with .NET 6 installed.

    The following steps consider an old ActiveReports 15's 'WinViewer' desktop application as a sample .NET Framework project that needs to be migrated to .NET Core 3.1/.NET 5/.NET 6 platform. The sample can be found on GitHub.

    For more information, please refer following Microsoft documentation:

    Upgrade the project from ActiveReports 15 to ActiveReports 16
    (skip this if you are already in ActiveReports 16)

    1. Open the \Desktop\WinViewer\C#\WinViewer.sln file in Visual Studio 2019 v16.8+.
    2. Convert the project to ActiveReports 16 by running the 'Convert to ActiveReports 16' tool.
      Convert to ActiveReports 15

      Analyze Portability
      (this step is for analysis purpose to see if the assemblies are portable to .NET Core; can be skipped)

    3. Click on Extensions > Manage Extensions and in the Manage Extensions dialog, search for '.NET Portability Analyzer' and download it. You may need to reopen the project for VSIX installer to run.
    4. Right-click on the WinViewer solution and click 'Analyze Assembly Portability'.
      Analyze Assembly Portability
    5. Save the Analysis report on your system and open it to analyze the portability details of your project.
      Save analysis report

      Migrate to .NET Core 3.1/.NET 5/.NET 6 platform

    6. Right-click 'packages.config' in the project, click 'Migrate packages.config to PackageReference..' and press OK.
      Migrate config
      You will see a NuGet migration log page with details.
    7. Right-click the project and select 'Unload Project'. Double-click 'WinViewer' in the Solution Explorer to view WinViewer.csproj file.

      WinViewer.csproj
    8. Remove the content of the WinViewer.csproj file and copy it in a text file so that the file appears blank and you have its backup in a text file.
    9. Add the following code to blank WinViewer.csproj file to change it to project SDK type.

      Note: The OutputType is "library" because the project is a class library project. Also, 'auto-generate assembly info' should be turned off.

      Show code

      .csproj
      Copy Code
      <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
      <OutputType>library</OutputType>
      <TargetFramework>net5.0-windows</TargetFramework>
      <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
      </PropertyGroup>
      </Project>
      
    10. Find the text "PackageReference" in the backup text file and copy the whole <ItemGroup> inside <Project> to WinViewer.csproj file. The final WinViewer.csproj will look like below:

      Show code

      .csproj
      Copy Code
      <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
          <OutputType>WinExe</OutputType>
          <TargetFramework>net5.0-windows</TargetFramework>
          <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
          <ApplicationIcon />
          <StartupObject />
        </PropertyGroup>
        <ItemGroup>
          <PackageReference Include="GrapeCity.ActiveReports.Chart.Win">
            <Version>16.0.0-alpha-106</Version>
          </PackageReference>
          <PackageReference Include="GrapeCity.ActiveReports.Export.Excel">
            <Version>16.0.0-beta-1201</Version>
          </PackageReference>
          <PackageReference Include="GrapeCity.ActiveReports.Export.Html">
            <Version>16.0.0-beta-1201</Version>
          </PackageReference>
          <PackageReference Include="GrapeCity.ActiveReports.Export.Pdf">
            <Version>16.0.0-beta-1201</Version>
          </PackageReference>
          <PackageReference Include="GrapeCity.ActiveReports.Export.Word">
            <Version>16.0.0-beta-1201</Version>
          </PackageReference>
          <PackageReference Include="GrapeCity.ActiveReports.Export.Xml">
            <Version>16.0.0-beta-1201</Version>
          </PackageReference>
          <PackageReference Include="GrapeCity.ActiveReports.Viewer.Win">
            <Version>16.0.0-beta-1201</Version>
          </PackageReference>
          <PackageReference Include="GrapeCity.DataVisualization.Chart">
            <Version>0.4.53</Version>
          </PackageReference>
          <PackageReference Include="Microsoft.NETCore.Platforms">
            <Version>1.1.0</Version>
          </PackageReference>
          <PackageReference Include="Microsoft.Win32.Primitives">
            <Version>4.3.0</Version>
          </PackageReference>
        </ItemGroup>
      </Project>
      
    11. Right-click the project in Solution Explorer and click on Reload project. You may see version errors for 'Compile Time Assemblies'. Resolve them by manually correcting the version as suggested in the window.
    12. Build the project to observe that the build is successful and the project has been successfully migrated to .NET Core 3.1/.NET 5/.NET 6 platform.
      Project Migrated