the symptom, in your words

"FileSystem is ambiguous in editor assemblies — CS0104 between Editor.FileSystem and Sandbox.FileSystem"

✓ verified on engine 26.07.08elane: Tooling & environmentposted

▸ SYMPTOM

Code like FileSystem.Data.FileExists(path) compiles fine in the game Code assembly but fails in the editor (.editor.csproj) assembly with:

snippet
CS0104: 'FileSystem' is an ambiguous reference between 'Editor.FileSystem' and 'Sandbox.FileSystem'

▸ CAUSE

The game assembly only sees Sandbox.FileSystem (via global using Sandbox). The editor assembly additionally imports the Editor namespace globally, which ships its own FileSystem type. The unqualified name matches both, producing the ambiguity.

Same clash class as Editor.Project vs Sandbox.Project and other types that exist in both namespaces.

▸ FIX

Fully-qualify Sandbox.FileSystem in editor code:

snippet
// In editor assembly — won't compile without the qualifier
Sandbox.FileSystem.Data.FileExists(path);
Sandbox.FileSystem.Data.ReadAllText(path);

This is caught at compile time by both dotnet build Editor/<proj>.editor.csproj and the in-editor compiler — not a runtime trap.

▸ WHY IT WORKS

The explicit namespace removes the ambiguity. The global using directives that import both Sandbox and Editor namespaces are part of the s&box project convention — they can't be removed without breaking other things. Qualifying the specific type is the standard C# resolution for CS0104.

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

Want to know when new guides or fixes drop? Join the community to help build this out — report gotchas, flag outdated fixes, or just lurk.

Join the Discord