File | Description |
---|---|
MyApps.sln | The name of the solution file. |
MyForms.csproj | The name of the .NET Framework Windows Forms project to port. |
MyFormsCore.csproj | The name of the new .NET Core project you create. |
MyAppCore.exe | The .NET Core Windows Forms app executable. |
AssemblyInfo.cs
file, which contains assembly attributes such as the version of the assembly to be generated. SDK-style projects automatically generate this information for you based on the SDK project file. Having both types of 'assembly info' creates a conflict. Resolve this problem by disabling automatic generation, which forces the project to use your existing AssemblyInfo.cs
file.<PropertyGroup>
node.false
, it won't generate the assembly attributes. This avoids the conflict with the existing AssemblyInfo.cs
file from the .NET Framework project.MyCoreApp
produces MyCoreApp.exe
.<PropertyGroup>
node in the MyFormsCore.csproj
file:<ItemGroup>
node to your project. Each statement includes a file glob pattern that includes child directories.<Compile>
or <EmbeddedResource>
entry for each file in your .NET Framework project.MetroFramework
, MetroFramework.Design
, and MetroFramework.Fonts
NuGet packages, add each to the project with either Visual Studio or the .NET Core CLI from the SolutionFolder directory:File | Description |
---|---|
MyApps.sln | The name of the solution file. |
MyControls.csproj | The name of the .NET Framework Windows Forms Controls project to port. |
MyControlsCore.csproj | The name of the new .NET Core library project you create. |
MyCoreControls.dll | The .NET Core Windows Forms Controls library. |
MyControlsCore.csproj
project and the previously created MyFormsCore.csproj
project.<OutputType>
node was removed, which defaults the compiler to produce a library instead of an executable. The <AssemblyName>
and <RootNamespace>
were changed. Specifically the <RootNamespace>
should match the namespace of the Windows Forms Controls library you are porting. And finally, the <Compile>
and <EmbeddedResource>
nodes were adjusted to point to the folder of the Windows Forms Controls library you are porting.<Source>
and <EmbeddedResource>
items. Fix the paths to any project reference used by your app. This effectively upgrades the .NET Framework project to a .NET Core project.