ActiveReports 15 .NET Edition
ActiveReports 15 User Guide / Upgrade Reports / Migrate .NET Framework Project to .NET 5 Platform
In This Topic
    Migrate .NET Framework Project to .NET 5 Platform
    In This Topic

    The following steps consider the ActiveReports 14's 'WinViewer' desktop application as a sample .NET Framework project which needs to be migrated to .NET Core 3.1/.NET 5 platform. The sample can be found on GitHub.

    For more information, please refer following Microsoft documentation:

     

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

    1. Open the Samples14-master\Desktop\WinViewer\C#\WinViewer.sln file in Visual Studio 2019 v16.8+.
    2. Convert the project to ActiveReports 15 by running the 'Convert to ActiveReports 15' 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.
    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 platform

    6. Right-click 'packages.config' in the project, click 'Migrate packages.config to PackageReference..' and press OK.
      Migrate config
    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-windows7.0</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>library</OutputType>
      <TargetFramework>net5.0-windows7.0</TargetFramework>
      <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
      </PropertyGroup>
      <ItemGroup>
      <PackageReference Include="GrapeCity.ActiveReports.Chart.Win">
      <Version>15.0.0-beta-68</Version>
      </PackageReference>
      <PackageReference Include="GrapeCity.ActiveReports.Export.Html">
      <Version>15.0.0-beta-725</Version>
      </PackageReference>
      <PackageReference Include="GrapeCity.ActiveReports.Export.Pdf">
      <Version>15.0.0-beta-725</Version>
      </PackageReference>
      <PackageReference Include="GrapeCity.ActiveReports.Export.Word">
      <Version>15.0.0-beta-725</Version>
      </PackageReference>
      <PackageReference Include="GrapeCity.ActiveReports.Export.Xml">
      <Version>15.0.0-beta-725</Version>
      </PackageReference>
      <PackageReference Include="GrapeCity.ActiveReports.Viewer.Win">
      <Version>15.0.0-beta-725</Version>
      </PackageReference>
      <PackageReference Include="GrapeCity.DataVisualization.Chart">
      <Version>0.3.304</Version>
      </PackageReference>
      <PackageReference Include="Microsoft.CSharp">
      <Version>4.5.0</Version>
      </PackageReference>
      <PackageReference Include="Newtonsoft.Json">
      <Version>11.0.2</Version>
      </PackageReference>
      <PackageReference Include="System.Data.Odbc">
      <Version>4.7.0</Version>
      </PackageReference>
      <PackageReference Include="System.Data.SqlClient">
      <Version>4.8.1</Version>
      </PackageReference>
      <PackageReference Include="System.Drawing.Common">
      <Version>4.7.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 platform.
      Project Migrated