Skip to content

Make the Hub build and run on modern .NET (net10 + Avalonia runtime-binding namespace fix)#1

Open
JeanxPereira wants to merge 2 commits into
mainfrom
fix/run-on-modern-net
Open

Make the Hub build and run on modern .NET (net10 + Avalonia runtime-binding namespace fix)#1
JeanxPereira wants to merge 2 commits into
mainfrom
fix/run-on-modern-net

Conversation

@JeanxPereira

Copy link
Copy Markdown

The Hub didn't build/run on a current machine. Two fixes get it launching cleanly — verified: the window opens, the first-run "Locate Darkspore" screen shows, and it exits cleanly with no exception.

1. Avalonia runtime-binding crash (the blocker)

Styles/Controls/TitleBar.axaml (and others) bind attached properties via runtime-parsed paths, e.g.:

{Binding Path=(rc:WindowChromeAddon.ManagedShowTitle), RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}

Avalonia's runtime (reflection) binding type-resolver can't resolve using:-style XML namespaces in these paths — it throws Unable to resolve type rc:WindowChromeAddon from any of the following locations: (the list is empty) on the first window measured, crashing startup on every window. Switching the affected xmlns declarations from using:ReCap.CommonUI[...] to clr-namespace:ReCap.CommonUI[...];assembly=ReCap.CommonUI makes them resolvable at runtime (semantically identical for compiled XAML). Applied to all 30 affected .axaml.

2. TFM net5.0 → net10.0

net5.0 is end-of-life and its runtime isn't present on modern machines, so the app couldn't run. Bumped ReCap.Hub to net10.0; the vendored ReCap.CommonUI stays netstandard2.0.

Verified

  • dotnet build src/ReCap.Hub/ReCap.Hub.csproj -c Debug_Offline and -c Release → 0 errors.
  • Runs natively on net10: window opens, shows the Locate-Darkspore first-run screen, closes cleanly.

Notes

  • Build the Hub with -c Debug_Offline (or Release); plain Debug intentionally errors on EnableReCapOnline.
  • ReCap.UITest still targets net5.0 (untouched; not needed to run the Hub) — easy follow-up.

TitleBar/TitleBarUnderlay (and others) bind attached properties via runtime-parsed
paths, e.g. {Binding Path=(rc:WindowChromeAddon.ManagedShowTitle), RelativeSource=...}.
Avalonia's runtime (reflection) type resolver cannot resolve `using:`-style XML
namespaces in these bindings — it throws "Unable to resolve type rc:WindowChromeAddon
from any of the following locations:" (empty) on the first window measured, crashing
startup. Qualifying the namespaces as clr-namespace:ReCap.CommonUI[...];assembly=ReCap.CommonUI
makes them resolvable at runtime (equivalent for compiled XAML). Applied to all 30 affected .axaml.
net5.0 is out of support and its runtime is no longer installed on modern machines,
so the Hub could not run. Bumped ReCap.Hub to net10.0 (vendored ReCap.CommonUI stays
netstandard2.0). Builds clean in Debug_Offline and Release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant