AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
26.05k stars 2.25k forks source link

[browser] WasmRuntimeAssetsLocation is not always provided by WebAssembly SDK #17388

Open maraf opened 3 weeks ago

maraf commented 3 weeks ago

Describe the bug

Avalonia browser assets rely on WasmRuntimeAssetsLocation in https://github.com/AvaloniaUI/Avalonia/blob/a06ae34732d5c897b9a627cbe13836e0bafb1943/src/Browser/Avalonia.Browser/build/Microsoft.AspNetCore.StaticWebAssets.props#L13. The property is not set if wasm-tools workload is not installed (WebAssembly SDK doesn't support it yet https://github.com/dotnet/runtime/issues/90979).

Introduced in https://github.com/AvaloniaUI/Avalonia/pull/14225 Reported by user in https://github.com/dotnet/runtime/issues/109266

To Reproduce

dotnet new install avalonia.templates
dotnet new avalonia.xplat
dotnet publish *.Browser
dir *.Browser/bin/Release/net8.0-browser/publish/wwwroot/_framework/avalonia.js

Expected behavior

No response

Avalonia version

11.1.0

OS

No response

Additional context

No response

kekekeks commented 3 weeks ago

The property is not set if wasm-tools workload is not installed

Without wasm-tools the SDK won't re-link the mono runtime with SkiaSharp included, so it will be broken anyway.