menu_bookDocumentation

Standalone Code: Full .NET Access and STANDALONE Constant for Exported Games

calendar_today May 20, 2026 schedule ~1 min read person PatrickJr verified 50

When s&box games are exported as standalone builds, they run outside the platform with additional capabilities not available in platform games.

STANDALONE Constant

Exported games compile with a STANDALONE constant for conditional code:
CSHARP
#if STANDALONE
// Code that only runs in an exported game
#endif

Disabling the Whitelist

Platform games enforce an API whitelist blocking dangerous .NET APIs. Standalone games can disable this entirely in project settings, giving full .NET runtime access. However, the game won't be publishable to the s&box platform while the whitelist is disabled.

This means standalone builds can use:

  • Full System.IO for file access

  • Network sockets and HTTP clients without restrictions

  • Any .NET library or NuGet package

  • Native interop and unsafe code

  • Database drivers and external service SDKs

Use the STANDALONE constant to provide fallback behavior for platform builds while taking advantage of full .NET in standalone exports.

Was this helpful?