You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Files ending in .skia.cs are not included when using net9.0-browserwasm with SkiaRendererΒ #20875
difficulty/medium π€Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIproject/core-tools π οΈCategorizes an issue or PR as relevant to core and tools
changed the title [-]Files ending in `.skia.cs` are not included when using `net9.0-browserwasm` with `SkiaRenderer`[/-][+]Files ending in `.skia.cs` are not included and `_UNO_SKIA__` is false when using `net9.0-browserwasm` with `SkiaRenderer`[/+]on Jun 25, 2025
changed the title [-]Files ending in `.skia.cs` are not included and `_UNO_SKIA__` is false when using `net9.0-browserwasm` with `SkiaRenderer`[/-][+]Files ending in `.skia.cs` are not included when using `net9.0-browserwasm` with `SkiaRenderer`[/+]on Jun 25, 2025
Are you sure? I just tested this myself and I can't seem to get a simple example to work where I transplanted the .skia.cs from the Uno.Samples/UI/SKCanvasElementShowcase to a project from a fresh template. Runs on desktop, fails to build for browserwasm, while a plain example without the .skia.cs runs fine for browserwasm.
You end up with a build failure that seems to indicate the .skia.cs file was not included:
Using launch settings from /home/lietu/src/Example/Example/Properties/launchSettings.json...
Building...
CSC : error UXAML0001: The type {using:Example.Presentation}SKCanvasElementImpl could not be found
/home/lietu/src/Example/Example/Presentation/MainPage.xaml(10,6): error UXAML0001: An error was found in Grid
/home/lietu/src/Example/Example/Presentation/MainPage.xaml(9,4): error UXAML0001: An error was found in ScrollViewer
/home/lietu/src/Example/Example/Presentation/MainPage.xaml(1,2): error UXAML0001: An error was found in Page
CSC : error UXAML0001: Processing failed for file /home/lietu/src/Example/Example/Presentation/MainPage.xaml (Uno.UI.SourceGenerators.XamlGenerator.XamlParsingException: An error was found in Page
/home/lietu/src/Example/Example/Presentation/MainPage.xaml.cs(11,14): error CS1061: 'MainPage' does not contain a definition for 'InitializeComponent' and no accessible extension method 'InitializeComponent' accepting a first argument of type 'MainPage' could be found (are you missing a using directive or an assembly reference?)
/home/lietu/src/Example/Example/Presentation/Shell.xaml.cs(7,14): error CS1061: 'Shell' does not contain a definition for 'InitializeComponent' and no accessible extension method 'InitializeComponent' accepting a first argument of type 'Shell' could be found (are you missing a using directive or an assembly reference?)
/home/lietu/src/Example/Example/Presentation/SecondPage.xaml.cs(7,14): error CS1061: 'SecondPage' does not contain a definition for 'InitializeComponent' and no accessible extension method 'InitializeComponent' accepting a first argument of type 'SecondPage' could be found (are you missing a using directive or an assembly reference?)
/home/lietu/src/Example/Example/App.xaml.cs(13,14): error CS1061: 'App' does not contain a definition for 'InitializeComponent' and no accessible extension method 'InitializeComponent' accepting a first argument of type 'App' could be found (are you missing a using directive or an assembly reference?)
/home/lietu/src/Example/Example/Presentation/Shell.xaml.cs(9,45): error CS0103: The name 'Splash' does not exist in the current context
/home/lietu/src/Example/Example/obj/Debug/net9.0-browserwasm/Uno.Extensions.Navigation.Generators/Uno.Extensions.Navigation.Generators.ForceBindingsUpdateGenerator/Example.Presentation.MainPage.g.cs(17,15): error CS1061: 'MainPage' does not contain a definition for 'Bindings' and no accessible extension method 'Bindings' accepting a first argument of type 'MainPage' could be found (are you missing a using directive or an assembly reference?)
/home/lietu/src/Example/Example/obj/Debug/net9.0-browserwasm/Uno.Extensions.Navigation.Generators/Uno.Extensions.Navigation.Generators.ForceBindingsUpdateGenerator/Example.Presentation.MainPage.g.cs(19,13): error CS1061: 'MainPage' does not contain a definition for 'Bindings' and no accessible extension method 'Bindings' accepting a first argument of type 'MainPage' could be found (are you missing a using directive or an assembly reference?)
The build failed. Fix the build errors and run again.
Could also just be I'm doing something wrong since the sample didn't really come with any documentation and the documentation on creating custom Skia components pretty much just refers to the sample.
If I go to the SKCanvasElementShowcase sample project and dotnet run -f net8.0-browserwasm it also fails with some different exceptions:
Using launch settings from /home/lietu/src/Uno.Samples/UI/SKCanvasElementShowcase/SKCanvasElementShowcase/Properties/launchSettings.json...
Building...
/usr/share/dotnet/sdk/9.0.300/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.Compression.targets(289,5): error MSB4018:
The "DiscoverPrecompressedAssets" task failed unexpectedly.
System.InvalidOperationException: File length for '/home/lietu/src/Uno.Samples/UI/SKCanvasElementShowcase/SKCanvasElementShowcas
e/bin/Debug/net8.0-browserwasm/dist/staticwebapp.config.json' is not defined.
at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.Validate()
at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.FromTaskItem(ITaskItem item)
at System.Linq.Enumerable.ArraySelectIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
at System.Linq.Enumerable.ArraySelectIterator`2.ToArray()
at Microsoft.AspNetCore.StaticWebAssets.Tasks.DiscoverPrecompressedAssets.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLo
ggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
The build failed. Fix the build errors and run again.
And well net9.0-browserwasm doesn't work because the project doesn't have a target for it.
Actually if I go in the same example project and just run dotnet build in the Example directory, the net9.0-desktop target succeeds, but net9.0-browserwasm, net9.0, and net9.0-android all fail with the same CSC : error UXAML0001: The type {using:Example.Presentation}SKCanvasElementImpl could not be found error.
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.
difficulty/medium π€Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIproject/core-tools π οΈCategorizes an issue or PR as relevant to core and tools
Activity
[-]Files ending in `.skia.cs` are not included when using `net9.0-browserwasm` with `SkiaRenderer`[/-][+]Files ending in `.skia.cs` are not included and `_UNO_SKIA__` is false when using `net9.0-browserwasm` with `SkiaRenderer`[/+][-]Files ending in `.skia.cs` are not included and `_UNO_SKIA__` is false when using `net9.0-browserwasm` with `SkiaRenderer`[/-][+]Files ending in `.skia.cs` are not included when using `net9.0-browserwasm` with `SkiaRenderer`[/+]ramezgerges commentedon Jun 25, 2025
False alarm. It's actually working.
lietu commentedon Jul 26, 2025
Are you sure? I just tested this myself and I can't seem to get a simple example to work where I transplanted the .skia.cs from the Uno.Samples/UI/SKCanvasElementShowcase to a project from a fresh template. Runs on desktop, fails to build for
browserwasm, while a plain example without the .skia.cs runs fine forbrowserwasm.It seems like this repo reproduces the issue rather well: https://github.com/lietu/UnoSkiaWebAssemblyIssue/commits/main/
In the repo:
cd Example dotnet run -f net9.0-desktopWorks fine.
If you instead do:
You end up with a build failure that seems to indicate the
.skia.csfile was not included:Could also just be I'm doing something wrong since the sample didn't really come with any documentation and the documentation on creating custom Skia components pretty much just refers to the sample.
If I go to the SKCanvasElementShowcase sample project and
dotnet run -f net8.0-browserwasmit also fails with some different exceptions:And well
net9.0-browserwasmdoesn't work because the project doesn't have a target for it.lietu commentedon Jul 26, 2025
Actually if I go in the same example project and just run
dotnet buildin theExampledirectory, thenet9.0-desktoptarget succeeds, butnet9.0-browserwasm,net9.0, andnet9.0-androidall fail with the sameCSC : error UXAML0001: The type {using:Example.Presentation}SKCanvasElementImpl could not be founderror.lietu commentedon Jul 26, 2025
If I open the SKCanvasElementShowcase project in Rider and select Android target in the run/debug configurations, then click Run, I run into https://youtrack.jetbrains.com/issue/RIDER-125880/Rider-always-compiles-all-TargetFrameworks-in-multi-TFM-projects causing the build to fail. So I had to remove these from
<TargetFrameworks>:Even still I run into the same error above with
staticwebapp.config.json:So can't confirm if this works on Android from the showcase either.
github-actions commentedon Oct 31, 2026
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.