How to Exclude Specific <Page> Items from WASM Build using Uno.Sdk Single Project? #18866
-
Hello Uno Platform community, I'm currently working on a project using Uno Platform with the new Despite my efforts to set <Project Sdk="Uno.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0-windows10.0.26100;net9.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>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<DefaultLanguage>en-US</DefaultLanguage>
<EnableDefaultItems>False</EnableDefaultItems>
<!--
UnoFeatures let's you quickly add and manage implicit package references based on the features you want to use.
https://aka.platform.uno/singleproject-features
-->
<UnoFeatures>
Hosting;
Logging;
Mvvm;
</UnoFeatures>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0-browserwasm'">
<None Remove="Page.xaml"/>
<Page Remove="Page.xaml"/>
</ItemGroup>
</Project> What I Want to Achieve: I would like to selectively exclude certain Questions:
Any guidance or examples from the community would be greatly appreciated! Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for the question! Given the structure of files inclusion in the Uno.SDK, the only way to remove files is to remove the files in a target, like this: <Target Name="AdjustAppItemGroups" BeforeTargets="ResolveAssemblyReferences">
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0-browserwasm'">
<None Remove="Page.xaml"/>
<Page Remove="Page.xaml"/>
</ItemGroup>
</Target> This target is executed as part of Design-Time builds and should be applied at the right times. Give it a try and let us know! |
Beta Was this translation helpful? Give feedback.
Thanks for the question!
Given the structure of files inclusion in the Uno.SDK, the only way to remove files is to remove the files in a target, like this:
This target is executed as part of Design-Time builds and should be applied at the right times.
Give it a try and let us know!