try-convert icon indicating copy to clipboard operation
try-convert copied to clipboard

ApplicationDefinition is missing when migrating from WPF project

Open droplet92 opened this issue 4 years ago • 0 comments

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>

droplet92 avatar Jan 25 '21 10:01 droplet92