WPF App Using new csproj format WPF App Using new csproj format wpf wpf

WPF App Using new csproj format


You need to set the Build Action of App.xaml to ApplicationDefinition. The result is the following item in your csproj file:

<ApplicationDefinition Include="App.xaml">  <Generator>MSBuild:Compile</Generator>  <SubType>Designer</SubType></ApplicationDefinition>


For people using this example to migrate to Visual studio 2019. Use the following for LanguageTargets. The current LanguageTargets example is specifically for 2017 and will not work under 2019. (Due to a new file location)

<LanguageTargets>$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Bin\Microsoft.CSharp.targets</LanguageTargets>