Ok, Guys, I have exactly the same question. How to migrate Windows Forms into Windows Forms Framework? I would like to achieve pure framework.
I know you can change for that purpose :
> <TargetFramework>net472</TargetFramework>
But it wont be exactly the same. From my point of view there is huge difference inside .csproject.
For example Windows Forms declaration:
> <Project Sdk="Microsoft.NET.Sdk">
>
> <PropertyGroup>
> <OutputType>WinExe</OutputType>
> <TargetFramework>net48</TargetFramework>
> <UseWindowsForms>true</UseWindowsForms>
> </PropertyGroup>
>
> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
> <PlatformTarget>x64</PlatformTarget>
> </PropertyGroup>
>
> <ItemGroup>
> <PackageReference Include="FontAwesome.Sharp" Version="5.15.4" />
> </ItemGroup>
>
> <ItemGroup>
> <Reference Include="Microsoft.CSharp" />
> <Reference Include="System.Deployment" />
> <Reference Include="System.Windows.Forms" />
> </ItemGroup>
>
> <ItemGroup>
> <Compile Update="Forms\Release-PDF.cs">
> <SubType>Form</SubType>
> </Compile>
> <Compile Update="Forms\Procesy-RM.cs">
> <SubType>Form</SubType>
> </Compile>
> <Compile Update="Forms\Release-RestApi.cs">
> <SubType>Form</SubType>
> </Compile>
> <Compile Update="Forms\Release-WS.cs">
> <SubType>Form</SubType>
> </Compile>
> <Compile Update="Forms\Release-WWW.cs">
> <SubType>Form</SubType>
> </Compile>
> <Compile Update="Resource.Designer.cs">
> <DesignTime>True</DesignTime>
> <AutoGen>True</AutoGen>
> <DependentUpon>Resource.resx</DependentUpon>
> </Compile>
> </ItemGroup>
>
> <ItemGroup>
> <EmbeddedResource Update="Resource.resx">
> <Generator>ResXFileCodeGenerator</Generator>
> <LastGenOutput>Resource.Designer.cs</LastGenOutput>
> </EmbeddedResource>
> </ItemGroup>
>
> </Project>
But in the same time Windows Forms Framework will be presenting like that:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BF10BA40-0932-49C8-A7F8-721010DC32D7}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Topola1</RootNamespace>
<AssemblyName>Topola1</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="MTRadioButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
It's a huge difference and as you see above.
Please let's not focus why I want to convert it into old good framework (I have my reasons where newer version just faults and the same code in framework just works..).
So please sitck with migrating approach.
Thank you in advance.