Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WPF][UnoIslands] Package references missing on UnoIslands Folders? #19509

Open
DevTKSS opened this issue Feb 11, 2025 · 3 comments
Open

[WPF][UnoIslands] Package references missing on UnoIslands Folders? #19509

DevTKSS opened this issue Feb 11, 2025 · 3 comments
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@DevTKSS
Copy link
Contributor

DevTKSS commented Feb 11, 2025

Current behavior

Working on a PR for updating forst instance the PackageReference Version Numbers the reader is told to add in hos WPF project in the the UnoIslands Documentation page, I followed exactly the steps told and have to report some issues I can not resolve on my own to just do a PR for this missing parts:

ThemeRessource

In the shared Project where we should Copy the code files like app.xaml and so on, I am getting the issue ThemeRessource is not supported in Presentation framework, maybe you are missing some assembly references

SkiaSharp

Tryed to build it after the steps finished to add the xamlHost element in the wpf app because I know some issues resolve if its just build, I am getting the issue telling that its missing a reference to SkiaSharp 🤔 i dont think someone did suddenly delete essentially resources but in the current version from nuget this seems to be missing?

Other

After building at checking what it did then tell me reviewing the shared Project, then it told me it do not know... Generally everything in the app.xaml file, but I think that might be resulting from previous listed missing namespaces which makes it usable to build.

Expected behavior

After updating the versions the files from the sample folder should work as expected and be

  1. Visible in the wpf designer
  2. No issues of missing additional imports
  3. Building solution properly

How to reproduce it (as minimally and precisely as possible)

Follow along the documentation page for UnoIslands in a .net 9 wpf application

Workaround

Unknown

Works on UWP/WinUI

None

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia, Uno.UI.DevServer / Uno.WinUI.DevServer, Other, Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

Generally 5.6.22 and the latest ones of wpf UnoIslands xamlhost ones from nuget.

Affected platforms

Skia (WPF), Build tasks

IDE

Visual Studio 2022

IDE version

Latest

Relevant plugins

SkiaSharp mentioned no idea which nuget we officially missing here?

Anything else we need to know?

Unknown required full nuget names, carefully to add more PackageReferences before checking the requirement of them. Theme resources might be requiring the uno.Themes but could also be a missing winui nuget. I do not know the fine details that makes a xamlhost element work

Could you please check in same sample if we are able to get the uno font contained as resource into the shared project or of this has to be added each wpf host? If so, I would like to add this information in the mentioned PR of the UnoIslands Documentation PR I am working on.

@DevTKSS DevTKSS added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 11, 2025
@jeromelaban
Copy link
Member

Thanks for the report.

Can you provide a step by step repro of what you are referring to? I'm not sure to get which sample you are mentioning.

@jeromelaban jeromelaban added the triage/needs-information Indicates an issue needs more information in order to work on it. label Feb 12, 2025
@DevTKSS
Copy link
Contributor Author

DevTKSS commented Feb 13, 2025

reffering to this documentation page: https://platform.uno/docs/articles/guides/uno-islands.html#updating-the-wpf-application-project

I updated the version numbers to the ones you can see in my PR to this part of the page update: #19521

getting this exception at trying to build the created WPF project:

Could not load file or assembly 'SkiaSharp, Version=2.88.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'. Das System kann die angegebene Datei nicht finden.

Since this Package is not listed at Updating the WPF application project I would assume, this package should be somehow nested in the listed Packages from Uno?

Next issue in same context:

Image

No changes applied to the UnoIslandsSampleApp.Shared\App.xaml only copied like told.
compared the shproj file and projitems files, which are matching exactly the same.

following the Adding and Uno Island steps:

Image

Image

is resulting in this Designer Exception on top.
As told, I did add the DataContext in the MainWindow Codebehind like this:

Image

I do not see my issue if there is one, do you see any?

For reference, this is how the solution explorer looks on my side, replicated what I did found in the Uno.Samples Repository linked from the documentation:

Image

Image

@github-actions github-actions bot removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Feb 13, 2025
@DevTKSS
Copy link
Contributor Author

DevTKSS commented Feb 17, 2025

Asked in the WindowsApp community server generally about when to use class library and shared project and got a interesting answer which maybe is an explanation why the unoislands created from the uno documentation page is throwing this compiler issue

🤔

Screenshot_2025-02-17-08-57-57-717_com.discord.jpg

So from this, I would consider that, beside proove of workflow replicated from the documentation for UnoIslands or eventually to be apply changes there, the project type, where the uno/winui specific xaml elements are defined have to be a class library, not a shared project, to successfully build the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

2 participants