Building Stride from Source — Detailed Guide
This document covers detailed build prerequisites, alternative build paths, and troubleshooting beyond what's in the top-level README.
Detailed Prerequisites
Visual Studio 2026 — Required Components
When installing VS 2026, make sure these are selected:
.NET desktop development workload — defaults are sufficient.
Desktop development with C++ workload — defaults are sufficient. Specific components used:
- Windows 11 SDK (10.0.22621.0 or later) (default)
- MSVC Build Tools for x64/x86 (Latest) (default — currently v145.x in VS 2026)
Optional components:
- MSVC Build Tools for ARM64/ARM64EC (Latest) — only needed if you actively develop or package for Windows ARM64. If missing, the ARM64 native build is automatically skipped with a warning (the rest of the build still succeeds).
- .NET Multi-platform App UI development + Android NDK 20.1+ (via Tools > Android > Android SDK Manager) — to target iOS/Android.
- Visual Studio extension development + .NET Framework 4.7.2 targeting pack — to build the VSIX package.
Note
The Visual Studio install with C++ + .NET workloads typically uses ~19 GB of disk space.
Warning
If this is your first time installing the .NET SDK, you might need to restart so that environment variables are picked up.
Build With Visual Studio
git clone https://github.com/stride3d/stride.git- Open
Stride.slnxin Visual Studio 2026. - Build the
Stride.GameStudioproject (default startup, in the60-Editorfolder) or run it directly from the toolbar.
Building Without Visual Studio
Using Build Tools + MSBuild
If you'd rather not install the full Visual Studio IDE:
- Install the .NET 10.0 SDK (bundled with VS Desktop Development workload, otherwise standalone).
- Install Visual Studio Build Tools (under Tools for Visual Studio → Build Tools for Visual Studio 2026), with the same workloads listed above.
- Add MSBuild to your
PATH(e.g.C:\Program Files\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\Bin). - Clone the repo:
git clone https://github.com/stride3d/stride.git - From the repo root, run:
msbuild -restore Stride.slnx
Using dotnet build
dotnet build works without Visual Studio loaded — it auto-selects the Clang toolchain for the native C++ projects:
dotnet build Stride.slnx
Stride auto-selects the native toolchain: MSVC when running under MSBuild.exe with the VS C++ tools loaded (VS Developer Command Prompt or IDE), Clang in every other case — including dotnet build from a Developer Command Prompt. See SDK-GUIDE.md → Native Build Mode for the full logic.
Running a Sample Against Your Local Build
Instantiates a sample from the locally built template packages, bound to this checkout's engine build (-devN dev version — see versioning.md). Works in both package modes:
- Produce the packages.
- Dev-redirect mode (
StrideRedirectPackages, the default in a checkout — fastest engine iteration): each engine build deploys redirect packages for the projects it built to%LocalAppData%\stride\nugetdev(~/.local/share/stride/nugetdevon Linux), mirrored intobin\packagesso the repo's own feed stays current too. The template packages this section needs come only from a full run, which deploys the whole set:
On Linux and macOS, it leaves out the projects that need Windows (WPF or Windows Forms, and those referencing them).dotnet run --file build/redirect-packages.cs - Normal mode (
StrideRedirectPackages=falseinbuild/Stride.Local.props, as on CI and in release builds): any engine build (Visual Studio ordotnet build Stride.slnx) auto-packs real packages intobin\packages.
- Dev-redirect mode (
- Deploy the package closure into the NuGet cache — this is what makes a version "installed" for the
strideCLI, and it purges stale same-version extractions so a rebuilt package actually takes effect:dotnet msbuild build/install-gamestudio.proj -t:Deploy - Instantiate (browse with
stride new list --version 4.4.0-devN). After a build,PublicVersionandNuGetVersionSuffixinsources/shared/SharedAssemblyInfo.Generated.csgive this checkout's version:stride new stride-animatedmodel --version 4.4.0-devN -n MySample -o C:\path\MySamplestride newupgrades a sample written for an older Stride to this version, so the generated project restores as-is. Without thestrideCLI installed, run it from source:dotnet run --project sources/launcher/Stride.Cli -- new .... - Build and run. The graphics API is a per-game choice; it must be one of the
StrideGraphicsApisvalues inbuild/Stride.Local.propsthe engine was built with:dotnet build C:\path\MySample\MySample.Windows\MySample.Windows.csproj -p:StrideGraphicsApi=Vulkan C:\path\MySample\Bin\Windows\Debug\MySample.Windows.exe
After engine changes: in dev-redirect mode rebuild the engine project, then rebuild the game (the redirect re-copies the tree's DLLs into its Bin); in normal mode rebuild (auto-repack) and run the Deploy step again.
Note
Any build run with -p:StrideRedirectPackages=false while dev-redirect packages are deployed deletes them (the intended cleanup when switching modes off). The next build without it deploys them again, project by project, or rerun redirect-packages.cs.
See also sources/templates/README.md for iterating on the template packages themselves.
Building and Testing on Linux (WSL)
A Linux machine, or WSL2 on Windows, can build the Linux runtime, its native code and the unit tests, and run the Vulkan tests on the CPU. This is a good way to repeat a failure of a Linux CI lane.
- Install the .NET 10.0 SDK and the native tools:
sudo apt install clang lld git-lfs libvulkan1 git lfs install - Clone inside the Linux file system, for example in
~/stride. Don't build in a Windows checkout through/mnt/c: it is slow and causes many build problems.- To test a branch of a Windows checkout, fetch it into the Linux clone:
git fetch /mnt/c/<path to the checkout> <branch>. This copies git objects only, so the line endings stay right. - Never copy the files of a Windows checkout into Linux. With
core.autocrlf=truethey have CRLF line endings, git then shows every file as changed, and a script without the.shextension fails withbash\r: No such file or directory. - A script written from Windows (for example through
\\wsl.localhost\) also gets CRLF line endings: runsed -i 's/\r$//' <file>before you run it.
- To test a branch of a Windows checkout, fetch it into the Linux clone:
- Build and test as the Linux CI lane does:
A test that compares text with adotnet build sources/Stride.Tests.Simple.Linux.slnf -p:StridePlatforms=Linux -p:StrideGraphicsApis=Vulkan -p:StrideTestRuntimeIdentifier=linux-x64 dotnet test sources/Stride.Tests.Simple.Linux.slnf --no-build\r\nstring fails on Linux: that is a real bug, CI sees it too.
Vulkan on the CPU. CI runs the Vulkan tests on Lavapipe, a software driver, from the Stride.Dependencies.Lavapipe package (setup-lavapipe-linux). Locally, the Lavapipe of Mesa also works:
sudo apt install mesa-vulkan-drivers
export VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json
Another version of Lavapipe can render slightly different images, so compare with the gold images only on CI.
Vulkan on the GPU. WSL has no Linux GPU driver, only Mesa's Dozen, which runs Vulkan on top of Direct3D 12. Results there don't tell how a real Linux driver behaves.
Game windows. Under WSLg, a game window opens on the Windows desktop. The graphics tests run without a window unless interactive mode is forced.
Troubleshooting
- Test project errors are usually normal — GameStudio will start anyway.
- The Visual Studio extension may fail to build without the Visual Studio SDK, but Game Studio will still start.
- Some changes require a system reboot — try that if you see
Could not find a compatible version of MSBuildorPath to dotnet executable is not set. - Make sure your
PATHdoesn't contain older MSBuild versions (e.g....\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Binshould be removed). - If an older Visual Studio is installed alongside VS 2026, ensure you're using VS 2026 specifically.
- Ensure Git, Git LFS, and Visual Studio can reach the internet.
- If problems persist: close Visual Studio, clear the NuGet cache (
dotnet nuget locals all --clear), delete.vsat the repo root and the files inbin/packages/, kill any runningmsbuild/dotnetprocesses, then rebuild.
Further Reading
- SDK-GUIDE.md — Stride build SDK internals (target structure, project SDK selection, native build modes)
- versioning.md — versioning & release: engine version, per-checkout
-devNdev versions, the release flow, and sample/template package versions - aot.md — NativeAOT & trimming: publishing games, feature switches for optional subsystems, keeping the engine AOT-clean
- plugins.md — plugins: runtime, Assets and Editor packages, how the tools find them, plugins inside a game's solution, the
stride-plugintemplate - ../../sources/templates/README.md —
dotnet newtemplate packages (Stride.Templates.Games / .Games.Starters / .Samples): end-user usage, local dev workflow, adding a new sample - ../../sources/launcher/README.md — the
strideCLI tool and the WPF launcher: usage, building (PackageCli), and the independent CLI release flow