Skip to content

Commit

Permalink
Merge pull request #18982 from unoplatform/dev/mazi/net9-windows-samp…
Browse files Browse the repository at this point in the history
…lesapp

fix: Allow building Samples App WinUI for .NET 9
  • Loading branch information
jeromelaban authored Jan 11, 2025
2 parents c992ed0 + 9734b04 commit cdf4548
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@
<NetPreviousWpf>$(NetPrevious)-windows</NetPreviousWpf>
<NetCurrentWpf>$(NetCurrent)-windows</NetCurrentWpf>

<NetPreviousWinAppSDK>$(NetPrevious)-windows10.0.19041.0</NetPreviousWinAppSDK>
<NetCurrentWinAppSDK>$(NetCurrent)-windows10.0.19041.0</NetCurrentWinAppSDK>

<NetMobilePreviousAndCurrent>$(NetPreviousNetCoreMobile);$(NetCurrentNetCoreMobile)</NetMobilePreviousAndCurrent>
<NetAndroidPreviousAndCurrent>$(NetPrevious)-android;$(NetCurrent)-android</NetAndroidPreviousAndCurrent>
<NetWpfPreviousAndCurrent>$(NetPreviousWpf);$(NetCurrentWpf)</NetWpfPreviousAndCurrent>
<NetWasmPreviousAndCurrent>$(NetPrevious);$(NetCurrent)</NetWasmPreviousAndCurrent>
<NetSkiaPreviousAndCurrent>$(NetPrevious);$(NetCurrent)</NetSkiaPreviousAndCurrent>
<NetReferencePreviousAndCurrent>$(NetPrevious);$(NetCurrent)</NetReferencePreviousAndCurrent>
<NetWinAppSDKPreviousAndCurrent>$(NetPreviousWinAppSDK);$(NetCurrentWinAppSDK)</NetWinAppSDKPreviousAndCurrent>
<NetUnitTests>$(NetPrevious)</NetUnitTests>

<NetUWPOrWinUI>uap10.0.19041</NetUWPOrWinUI>
Expand Down
4 changes: 3 additions & 1 deletion src/SamplesApp/SamplesApp.Windows/SamplesApp.Windows.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>$(NetPrevious)-windows10.0.19041.0</TargetFramework>
<TargetFramework>$(NetPreviousWinAppSDK)</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>SamplesApp.Windows</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand All @@ -19,6 +19,8 @@
<WindowsSdkPackageVersion>10.0.19041.53</WindowsSdkPackageVersion>
</PropertyGroup>

<Import Project="../../targetframework-override.props" />

<ItemGroup>
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
Expand Down
4 changes: 2 additions & 2 deletions src/Uno.CrossTargetting.targets
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' != 'uap10.0.19041' and '$(TargetFramework)'!='net8.0-windows10.0.19041.0' and '$(TargetPlatformIdentifier)' != 'UAP'">
<PropertyGroup Condition=" '$(TargetFramework)' != 'uap10.0.19041' and $(TargetFramework.EndsWith('-windows10.0.19041.0')) != 'true' and '$(TargetPlatformIdentifier)' != 'UAP'">
<DefineConstants>$(DefineConstants);HAS_UNO</DefineConstants>
<DefineConstants Condition="'$(UNO_UWP_BUILD)'!='true'">$(DefineConstants);HAS_UNO_WINUI</DefineConstants>

Expand All @@ -111,7 +111,7 @@
<DefaultXamlRuntime Condition="'$(DefaultXamlRuntime)'==''">WinUI</DefaultXamlRuntime>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net8.0-windows10.0.19041.0'">
<PropertyGroup Condition="$(TargetFramework.EndsWith('-windows10.0.19041.0'))">
<DefineConstants>$(DefineConstants);HAS_INPUT_INJECTOR;WINDOWS_WINUI;HAS_RENDER_TARGET_BITMAP;HAS_COMPOSITION_API</DefineConstants>
</PropertyGroup>

Expand Down

0 comments on commit cdf4548

Please sign in to comment.