Spread Windows Forms supports .NET 6 platform. If you want to migrate a .NET Framework project to .NET 6 platform, go through the detailed steps mentioned in this topic.
The following steps consider 'GrapeCity.AgingReport' as a sample .NET Framework project which needs to be migrated to .NET 6 platform. You can also locate this project on your system at C:\Program Files (x86)\Mescius\Spread.NET [version]\Windows Forms\[version]\Samples\C#\Spread.Examples\ after you install SpreadWin successfully.
(This section helps you to check if the code in your project is portable and supported on .NET 6 platform. You can ignore this section if you are already clear about the project portability.)
(In this example, there are 3 projects in the solution where GrapeCity.AgingReport project refers to Spread.Common.DataStore and Spread.Common.Feature project. Hence GrapeCity.AgingReport project will be migrated after migrating the other two projects.)
Spread.Common.DataStore.csproj |
Copy Code
|
---|---|
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>library</OutputType> <TargetFramework>net6.0-windows</TargetFramework> </PropertyGroup> </Project> |
Spread.Common.DataStore.csproj |
Copy Code
|
---|---|
<ItemGroup> <PackageReference Include="Newtonsoft.Json"> <Version>11.0.2</Version> </PackageReference> </ItemGroup> |
Spread.Common.DataStore.csproj |
Copy Code
|
---|---|
<PropertyGroup> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup> |
Spread.Common.DataStore.csproj |
Copy Code
|
---|---|
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>library</OutputType> <TargetFramework>net6.0-windows</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Newtonsoft.Json"> <Version>12.0.3</Version> </PackageReference> <PackageReference Include="System.Data.OleDb" Version="4.7.1" /> </ItemGroup> <PropertyGroup> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup> </Project> |
You can migrate Spread.Common.Features project to .NET 6 platform in the same way as Spread.Common.DataStore project in above section (except the installation of System.Data.OleDB Nuget package in step 8). The final code of Spread.Common.Features.csproj will look like below:
Spread.Common.Features.csproj |
Copy Code
|
---|---|
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>library</OutputType> <TargetFramework>net6.0-windows</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Newtonsoft.Json"> <Version>12.0.3</Version> </PackageReference> </ItemGroup> <PropertyGroup> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup> </Project> |
Rebuild Spread.Common.Features project to observe that the build is successful and the project has been successfully migrated to .NET 6 platform.
You can migrate GrapeCity.AgingReport project to .NET 6 platform in the same way as Spread.Common.DataStore project in above section except the following:
The final code of GrapeCity.AgingReport.csproj will look like below:
GrapeCity.AgingReport.csproj |
Copy Code
|
---|---|
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net6.0-windows</TargetFramework> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\..\Common\Spread.Common.DataStore\Spread.Common.DataStore.csproj"> <Project>{6e4896e5-e77c-4276-93d3-f52cc1d3c4a5}</Project> <Name>Spread.Common.DataStore</Name> </ProjectReference> <ProjectReference Include="..\..\Common\Spread.Common.Features\Spread.Common.Features.csproj"> <Project>{08b57d63-d0ad-431a-819a-c3a00f479feb}</Project> <Name>Spread.Common.Features</Name> </ProjectReference> </ItemGroup> <PropertyGroup> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup> </Project> |
Rebuild GrapeCity.AgingReport project to observe that the build is successful and the project has been successfully migrated to .NET 6 platform.