Duplicate 'Page' items were included build error encountered while compiling WinUI3 control library. #8915
ToddGlodek
started this conversation in
General
Replies: 1 comment 1 reply
-
I found that the error is encountered when you create a totally new project/solution of type - so it cant be related to my code or the legacy .csproj file XML formats/data. I created a new bug - New/Blank Control Library Produces Build Error (Duplicate 'Page' items were included build error) (v 4.3.6.9) #8921 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I attempted to convert a Uno proof of concept app from UWP into WinUI following the documentation : How to Create Control Libraries. However, instead of using templated controls, I am creating several different controls that inherit from UserControl.
Initially I encountered the issue BLOCKER : Converting/Repurposing UWP Shared Project in WinUI3 project. That issue (which was related to a defect in the script for creating a new Uno Library Project using the latest ( v 4.3.6.9 ) templates ) can be worked around by changing the .csproj file as follows :
<ItemGroup Condition="'$(TargetFramework)'=='net5.0-windows10.0.18362'"> **<< Change to NET6.0
Now I am encountering a new build error :
Duplicate 'Page' items were included. The .NET SDK includes 'Page' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultPageItems' property to 'false' if you want to explicitly include them in your project file.
I encounter this error even though I do not have any controls included in the .csproj.
The error details refers you to a discussion of default-includes-and-excludes. The main take away from that discussion is that you should consider setting
<EnableDefaultItems>false</EnableDefaultItems>
. However, this just leads to a different error :Xaml Internal Error error WMC9999: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
I believe the original error is related to this duplicate items check in the Microsoft.WinUI.Targets file - but I dont know enough about the mechanics of the build system to diagnose this myself.
Also, when you Google "Duplicate 'Page' items were included build" you will find a recent issue on SyncFusion's Forum from Feb 1, 2022 that also deals with WinUI. This may indicate that it is not a Uno Platform problem specifically. However, it still blocks the Uno Platform build process from completing a build.
Beta Was this translation helpful? Give feedback.
All reactions