Files
Prism/e2e/Uno/Playground.Module/Playground.Module.csproj
Dan Siegel 109bc4a667 Resolve Uno.WinUI build conflicts with Windows App SDK
The `NETSDK1022` error, caused by conflicting default item inclusion rules between Uno.Sdk and Windows App SDK/WinUI for `Page` and `PRIResource` items, prevented successful builds for `net*-windows10*` target frameworks.

This change addresses the issue by:
- Updating `Microsoft.Windows.SDK.BuildTools`.
- Explicitly setting `IsWinAppSdk` to `true` for `windows10` TFMs.
- Disabling `EnableDefaultPriItems` and `EnableDefaultPageItems` for `windows10` TFMs.
- Explicitly listing necessary `Page` and `PRIResource` items for `windows10` targets in relevant projects.
- Updating `UnoTargetFrameworks` for tvOS to specific versions.
- Adjusting `Microsoft.Xaml.Behaviors.WinUI.Managed` package references conditionally for `windows10` targets.

This ensures Uno.WinUI projects compile correctly and consistently when integrated with the Windows App SDK.
2026-05-14 10:26:16 -06:00

53 lines
2.6 KiB
XML

<Project Sdk="Uno.Sdk">
<PropertyGroup>
<!--
net*-windows10*: duplicate WinUI default Page items (overlapping WindowsAppSDK imports) → NETSDK1022.
Match HelloWorld: pin WinAppSdk, disable default Page for this TFM, list XAML explicitly.
-->
<IsWinAppSdk Condition="$(TargetFramework.Contains('windows10'))">true</IsWinAppSdk>
<EnableDefaultPageItems Condition="$(TargetFramework.Contains('windows10'))">false</EnableDefaultPageItems>
<!-- TFMs match the consuming app. Omit SkiaRenderer (see HelloWorld.csproj): Uno ReplaceUnoRuntime / RuntimeAssetsSelectorTask fails on Android/iOS when Skia is forced for those heads. -->
<TargetFrameworks>net10.0-desktop;net10.0-android;net10.0-ios;net10.0-windows10.0.26100;net10.0-browserwasm</TargetFrameworks>
<UnoSingleProject>true</UnoSingleProject>
<OutputType>Library</OutputType>
<!-- Ensures the .xr.xml files are generated in a proper layout folder -->
<GenerateLibraryLayout>true</GenerateLibraryLayout>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup Condition="!$(TargetFramework.Contains('windows10'))">
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.WinUI.Managed" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('windows10'))">
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('windows10'))">
<Page Include="Dialogs\*.xaml" />
<Page Include="Views\*.xaml" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
<!--
If you encounter this error message:
error NETSDK1148: A referenced assembly was compiled using a newer version of Microsoft.Windows.SDK.NET.dll.
Please update to a newer .NET SDK in order to reference this assembly.
This means that the two packages below must be aligned with the "build" version number of
the "Microsoft.Windows.SDK.BuildTools" package above, and the "revision" version number
must be the highest found in https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref.
-->
<!-- <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.22621.28" />
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.22621.28" /> -->
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Prism.Core\Prism.Core.csproj" />
<ProjectReference Include="..\..\..\src\Uno\Prism.Uno\Prism.Uno.WinUI.csproj" />
</ItemGroup>
</Project>