-
Notifications
You must be signed in to change notification settings - Fork 824
Description
Current behavior
If you create an Uno Class Library with some code and a small addition to the .csproj:
<ItemGroup>
<Content Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" />
<Content Include="**\*.cs" Exclude="bin\**\*.cs;obj\**\*.cs" />
</ItemGroup>This content is included in the build output and can be accessed via StorageFile.GetFileFromApplicationUriAsync() under UWP and WinAppSDK (uap10.0.18362;net6.0-windows10.0.19041.0):
However, under any other TFMs where Uno.UI is used, including netstandard2.0, net6.0-ios, net6.0-macos ,net6.0-maccatalyst, net6.0-android, and older TFMs that don't use NET6, the content is neither included in the final build nor accessible with StorageFile.GetFileFromApplicationUriAsync():
Expected behavior
Behavior should be consistent between all platforms.
How to reproduce it (as minimally and precisely as possible)
Attached is a project with a complete, minimal repro of the issue, and should be ready-to-run assuming you've got the proper dependencies and tooling (.NET 6 / MAUI / VS 2022).
This is the same project used to create the screenshots above.
ConsistentContentIncludeBehavior.zip
Workaround
The only potential workaround is to create a custom MSBuild Target that
- Checks the head for all referenced projects
- Checks each referenced project for any usages of
<Content Include="..."/> - Manually copy the files to the project head's "Assets" folder
Then, modify all of your code to only use the Assets folder.
Works on UWP/WinUI
Yes
Environment
Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia, Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
NuGet package version(s)
4.0.11
Affected platforms
iOS, Android, WebAssembly, WebAssembly renderers for Xamarin.Forms, macOS, Skia (WPF), Skia (GTK on Linux/macOS/Windows), Skia (Tizen)
IDE
Visual Studio 2022
IDE version
17.0.5
Relevant plugins
No response
Anything else we need to know?
No response







