* Use `Microsoft.NET.Sdk.StaticWebAssets` in Avalonia.Browser, rely on built-in assets packaging
* Update ControlCatalog.Browser to use OverrideHtmlAssetPlaceholders + fingerprint
* Fix default BrowserPlatformOptions.FrameworkAssetPathResolver behavior
* Remove outdated ShouldIncludeNativeSkiaSharp/ShouldIncludeNativeHarfBuzzSharp
* Update BuildTests.Browser
* Support static web assets in single project browser apps
The browser TFM now layers Microsoft.NET.Sdk.WebAssembly on top of Microsoft.NET.Sdk,
so Avalonia.Browser's javascript resolves from _content/Avalonia.Browser/.
The static web assets SDK only discovers wwwroot at the project root and offers no
property to relocate it, so define the assets under $(BrowserProjectFolder)wwwroot
directly. WasmExtraFilesToDeploy is kept for the legacy WasmApp model and is now
guarded so the two paths cannot both run.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Restore WasmExtraFilesToDeploy fallback
* Remove unused runtimeconfig.template.json
* Fingerprint Avalonia.Browser javascript from the app build
Avalonia.Browser no longer packs its javascript as static web assets.
build/Avalonia.Browser.targets defines them in the consuming app instead,
the same way Microsoft.NET.Sdk.BlazorWebAssembly handles blazor.webassembly.js.
A hard fingerprint renames the file, which plain static hosting needs,
but it does not survive dotnet pack on the .NET 10 SDK:
the packed props record the resolved name and drop the marker,
so no import map entry is emitted and package consumers request a file that was never renamed.
Evaluating the expression in the app keeps it intact.
.NET 11 fixes pack, but only for consumers on the .NET 11 SDK.
avalonia.js and storage.js are fingerprinted, sw.js and the source maps are not:
those load by URL through serviceWorker.register and sourceMappingURL,
which the import map does not rewrite.
The project drops back to Microsoft.NET.Sdk,
so it no longer emits staticwebassets.runtime.json and .endpoints.json next to the assembly.
A project reference carried those into the app output and made the wasm dev server
serve the app from the wrong manifest, 404ing the icu .dat and .pdb files.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1TywZ5LUqgagfuzPcxjf5
* Only fingerprint Avalonia javascript when an import map is generated
A renamed file resolves only through the import map,
which the SDK emits only when OverrideHtmlAssetPlaceholders is true.
Apps that do not opt in got renamed files and an empty import map placeholder,
so JSHost.ImportAsync requested a file that no longer existed.
$(StaticWebAssetsFingerprintContent)=false is now honoured too.
Prefer wwwroot/ over staticwebassets/ when locating the javascript.
esbuild wrote to staticwebassets/ before this branch and both are gitignored,
so a leftover directory would otherwise shadow the current output forever.
Skip the assets, and AVA3002, in design time builds.
Those do not build the project reference, so wwwroot may legitimately be absent.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1TywZ5LUqgagfuzPcxjf5
* Serve the Avalonia service worker from the app root
A service worker is scoped to its own directory,
and the save picker polyfill looks the registration up with getRegistration(),
which matches against the document URL.
From _content/Avalonia.Browser/ the lookup found nothing,
so every save fell back to buffering the whole file into a Blob
instead of streaming through the worker.
Rename the entry point to avalonia-sw.ts and place the output at the app root,
which is the only location whose default scope covers the document.
The polyfill builds its URLs from sw.scope, so nothing else has to change.
Registration was already broken before this branch for a different reason:
the path resolved to ./sw.js while the file shipped under _framework/,
so register() hit a 404 that nothing observed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1TywZ5LUqgagfuzPcxjf5
* Remove unused modulepreload
* Fix duplicated _AvaloniaBrowserStaticWebAsset for AvaloniaSingleProject.targets
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* MVP SingleProject support for all supported platforms
* Convert MobileSandbox to be a single project
* WASM fixes
* Fix SDK CI version
* Use .NET 8 in build project as well
* Add EnableUnsafeBinaryFormatterSerialization
* Add macos workload, remove wasm-experimental
* And ios
* Specify TFM for single-project projects in dirs.proj
* Return deleted line
* Set PrivateAssets=all on MobileSandbox
* Add ios target only on non-linux in MobileSandbox
* Update after merges
* Update browser sub-project from the templates
* Don't build MobileSandbox on CI
* Couple of improvements
* Add android hack to run without manifest
* Add tvOS support and rearrange some properties
* Delete unusable Packages.targets file + related
* Add global Condition for AvaloniaSingleProject.targets
* Add .NET 8 target to packable projects
* Update test projects
* Update sample projects to target .NET 8
* Update main Avalonia package to target .NET 8 as well
* Remove MSBuildEnableWorkloadResolver hack and some minor change
* Use net8.0 in nuke build as well
* Pin 8.0.0 SDK
* Adjust API validation
* Pin a valid version
* Remove net461 target from Avalonia package
* Remove unused net6.0 target from Avalonia.Designer.HostApp
* Adjust API diff
* Update ControlCatalog.Android.csproj
* Remove MSBuildEnableWorkloadResolver
* Fix Browser issues on .NET 8
* Fix .NET 8 error
* Fix merge conflicts
* Replace explicit TFMs in .csproj files with a centralized registry
* Fix merge conflict
* Fix AvsLegacyWindowsTargetFrameworks and add hacks for the tests
* Update XCode project CommandLineArgument
---------
Co-authored-by: Nikita Tsukanov <keks9n@gmail.com>