Setting Up Your Dev Environment
Configure your IDE, install extensions, and set up hot-reload for a smooth development workflow.
s&box uses C# end-to-end, and the engine is designed to live next to your IDE rather than replace it — when you save a .cs or .razor file, the engine recompiles and live-reloads the new code into the running game in milliseconds. That means a comfortable IDE setup pays off immediately. Visual Studio, JetBrains Rider, and VS Code are all first-class.
Open the generated solution
Every s&box project is a .NET solution. When you open a project in the editor it generates a .sln file at the root of the project folder alongside the .sbproj. Double-clicking the .sln launches Visual Studio (or whichever IDE you have associated with .sln files) with all the right project references — including Sandbox.Game, Sandbox.System, and the engine's source-generated code. If you also have an editor folder in your project, you'll get a second project named <YourProject>.editor that can reference both tools and game code.
Use any of the supported IDEs
Visual Studio 2022 (the free Community edition is fine) is the most-tested option. JetBrains Rider works equally well — point it at the generated .sln and Rider will pick up the Sandbox SDK assemblies automatically. VS Code is supported for lighter editing, with an official Facepunch/sbox-vscode extension that adds Razor and shader-graph awareness. There is no special build step you need to run from the IDE; the engine itself owns compilation.
Trust hot reload, don't rebuild manually
Save the file, alt-tab to s&box, and your change is already live. The hotload system patches IL into the running process, so method-body changes are nearly instant; bigger structural changes (adding fields, renaming types) trigger a heap walk to upgrade existing instances. You don't run dotnet build — in fact, building from the IDE is unnecessary and can confuse the engine's own compiler. If something gets stuck, type 'hotload_log 2' in the s&box console to see what's slow or leaking, and restart the editor as a last resort.
// Save this file in your IDE — the new value of Speed is live in s&box
// the next frame, no rebuild required.
using Sandbox;
public sealed class Mover : Component
{
[Property] public float Speed { get; set; } = 250f;
protected override void OnUpdate()
{
WorldPosition += Vector3.Forward * Speed * Time.Delta;
}
}Know the API whitelist
Platform games (anything you publish to sbox.game) run under an API whitelist that blocks risky .NET surface area like System.IO and arbitrary reflection. Your IDE will see those types, but the s&box compiler will emit an SB1000 'Whitelist Error' when you use one. Use Log.Info instead of Console.WriteLine, and use the Sandbox FileSystem API instead of System.IO. Standalone exports can opt out of the whitelist, but they cannot then be published back to the platform.
Working project layout
A typical project folder contains the .sbproj manifest, a Code/ folder for your C#, an Assets/ folder for art and prefabs, optional editor/ and shaders/ folders, and the auto-generated .sln + obj/ folders for the IDE. You commit Code/, Assets/, the .sbproj, and editor configs; you ignore obj/, bin/, .vs/, and .idea/ (see the team workflow guide for a full .gitignore).