PublishSingleFile=true
support for desktop targets
#20078
Labels
difficulty/tbd
Categorizes an issue for which the difficulty level needs to be defined.
kind/enhancement
New feature or request
triage/untriaged
Indicates an issue requires triaging or verification
It's never clearly stated in docs that this is not supported, so I tried it out on Windows.
First place where it fails is here with a quite unhelpful error message which OOB in a new project I could only find in Event Viewer since it happens before any logger is set up.
uno/src/Uno.UI.Runtime.Skia.Wpf/Builder/WpfHostBuilder.cs
Lines 75 to 86 in 76630e0
This is because
Assembly.Location
always returnsstring.Empty
w/PublishSingleFile=true
, butUri.TryCreate
returnstrue
for an empty string for some reason so the code tries to accessuri.LocalPath
that subsequently throws.Nowadays we should probably use
RuntimeEnvironment.GetRuntimeDirectory()
when we want to find the shared framework, andAppContext.BaseDirectory
for whenuseSharedFramework
isfalse
(self-contained and single-file builds).Then I started looking around and I see the code uses
Assembly.Location
in a lot of places.That's totally fair.
So my suggestion for now is to mention the nonsupport in the docs and adjust the abovementioned code to give a more useful and instructive error message. Adjusting the code would make it more future-proof too, considering the comment there.
Then full support would have to be a larger feature up for consideration, I'm sure.
Why is this needed
Simplifies portable app distribution for (at least some) desktop platforms.
For which platform
Skia (WPF), Skia (Linux X11), Skia (macOS), Skia (Linux Framebuffer), Skia (GTK), Windows (WinAppSDK)
The text was updated successfully, but these errors were encountered: