Skip to content

Commit

Permalink
Fix builds on WinUI and UWP .NET 9 projects (#15004)
Browse files Browse the repository at this point in the history
* Fix builds on UWP .NET 9 projects

* Fix builds for WinUI as well
  • Loading branch information
Sergio0694 authored Feb 7, 2025
1 parent a815dc0 commit 4b76425
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@
<!--
Output type for .NET Core test projects should be exe.
https://devdiv.visualstudio.com/DevDiv/_workitems?id=375688&_a=edit
Note: we skip this for WinUI and UWP apps, as they must use 'WinExe'.
-->
<PropertyGroup>
<OutputType>Exe</OutputType>
<OutputType Condition="'$(UseWinUI)' != 'true' AND '$(UseUwpTools)' != 'true'">Exe</OutputType>
</PropertyGroup>

<PropertyGroup>
<GeneratedProgramFile Condition="'$(GeneratedProgramFile)' == ''">$(MSBuildThisFileDirectory)Microsoft.NET.Test.Sdk.Program$(DefaultLanguageSourceExtension)</GeneratedProgramFile>

<!--
We always skip the generated entry point for UWP apps on .NET 9, as those need a separate entry point
to initialize the 'CoreApplication' app, which is handled separately. That is, it will either be in
the project template, or generated by the XAML compiler (for UWP XAML apps). We also do the same
for WinUI apps, since those also have a special entry point produced by the XAML compiler.
-->
<GenerateProgramFile Condition="'$(GenerateProgramFile)' == '' AND ('$(UseWinUI)' == 'true' OR '$(UseUwpTools)' == 'true')">false</GenerateProgramFile>
<GenerateProgramFile Condition="'$(GenerateProgramFile)' == ''">true</GenerateProgramFile>
</PropertyGroup>

Expand Down

0 comments on commit 4b76425

Please sign in to comment.