s&box/field-guide
the symptom, in your words

"Assembly.cs global usings as project bootstrap"

✓ verified on engine 26.07lane: Getting set upposted
▸ SYMPTOM
  • C# can't find your Razor panels (Hud not found).
  • Every file needs the same using Sandbox; / using System.Linq; boilerplate or won't compile.
  • Razor resolves Sandbox built-ins over your types.
▸ CAUSE

Code/Assembly.cs is the assembly-wide global usings file. Razor classes do not land in the global namespace — they need @namespace YourGame and global using YourGame; here, or the rest of the project can't see them (razor-namespace-trap).

▸ FIX
snippet
global using Sandbox;
global using System;
global using System.Collections.Generic;
global using System.Linq;
global using System.Threading.Tasks;
global using YourGame; // MUST match @namespace in every .razor

In every .razor:

snippet
@namespace YourGame
@inherits PanelComponent

csproj notes: TargetFramework net10.0, Razor via Microsoft.NET.Sdk.Razor, references Steam s&box managed DLLs. Verify with:

snippet
dotnet build Code\<project>.csproj

Don't name gameplay classes after Sandbox built-ins (PlayerController, etc.) — Razor prefers Sandbox.* and you get baffling "no such member" errors.

▸ WHY IT WORKS

Global usings apply to every compilation unit in the game assembly. Matching global using to Razor's @namespace puts generated panel types in the same scope as your components, which is the whole point of a single Assembly.cs bootstrap file.

Verified on engine 26.07 — seen in a real project.
s&box moves fast; an undated fix is a liability. Spot a stale detail?