try-convert
try-convert copied to clipboard
ApplicationDefinition is missing when migrating from WPF project
I have migrated my c# project from .NET framework 4.7.2 to .NET 5 using try-convert. After receiving the completion message, I reopened the project and tried to build it but I got a failure message that there was no program entry point (no static main). I was wondering what problem occurred and I soon found out my App.xaml is no longer an ApplicationDefinition.
Here is a part of my original .NET framework 4.7.2 csproj file:
<ItemGroup>
<ApplicationDefinition Include="src\App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="src\Managers\DBManager.cs" />
<Compile Include="src\Views\MainMenuView.xaml.cs">
<DependentUpon>MainMenuView.xaml</DependentUpon>
</Compile>
...
</ItemGroup>
and here is a part of .NET 5 csproj file generated by try-convert:
<ItemGroup>
<Compile Include="src\Managers\DBManager.cs" />
<Compile Include="src\ViewModels\MainMenuViewModel.cs" />
...
</ItemGroup>