Skip to content

Use a newer .NET in your game without waiting for a new Game Studio - #3440

Merged
xen2 merged 10 commits into
stride3d:masterfrom
xen2:feature/multitarget-future-tfm
Sep 16, 2026
Merged

xen2 merged 10 commits into
stride3d:masterfrom
xen2:feature/multitarget-future-tfm

Conversation

@xen2

@xen2 xen2 commented Sep 15, 2026

Copy link
Copy Markdown
Member

Game Studio 4.4 is built for .NET 10. Until now, a game had to target the same .NET version as the editor: move your game to .NET 11, and Game Studio could not load it anymore.

With this PR, you can move your game to .NET 11 (or any later version) and keep using the same Game Studio. When a project needs a newer .NET, Game Studio restarts itself on it. The asset compiler does the same during dotnet build.

Related issues

What you can do

Move your game to .NET 11

  1. Install the .NET 11 SDK.
  2. Change <TargetFramework> in your game projects to net11.0.
  3. Open the project in Game Studio, as usual.

Game Studio notices that the project needs .NET 11 and restarts on it. The window title shows the .NET version it runs on, together with the graphics API:

image

Opening another project later (File > Open, File > New) switches back and forth between .NET 10 and .NET 11 as each project needs. dotnet build of the game runs the asset compiler on .NET 11 too.

Get a clear message when .NET is missing

If the project needs a .NET version that is not installed, Game Studio tells you what is missing and where to get it, then returns to the project selection window:

image

Try Game Studio on a newer .NET from the launcher

When a newer .NET is installed, the launcher shows a runtime selector below the version. The default is the editor's own .NET, and each newer version is offered as a minimum:

image
  • .NET 10 or newer (default): Game Studio runs on .NET 10, or on what the project needs.
  • .NET 11 or newer: Game Studio runs on .NET 11 even for a .NET 10 project, for example to try your project on .NET 11 before moving it.

A project that needs a newer version always gets it. The selector only appears for Stride versions that support it, so older versions work as before. With only one .NET installed, it stays hidden.

Note: it's the same selector we had a long time ago when we had both .NET Framework and .NET Core side by side.

Same from the command line

stride studio                         # restarts on the .NET version the project needs
stride studio --framework net11.0     # at least .NET 11

Start with only a newer .NET installed

Game Studio, the launcher, the CLI and the asset compiler now start even when .NET 10 is not installed, as long as a newer version is. When .NET 10 is installed, they keep using it.

How it works

Choosing the .NET version

DotNetHostSelector (in sources/shared/Stride.NuGetResolver, used by Game Studio, the launcher and the CLI) picks the .NET major from:

Input Rule
The session's executable projects First TargetFramework(s) entry, from obj/project.assets.json or the csproj. A minimum.
--framework net11.0 or STRIDE_RUNTIME_MAJOR (launcher choice, CLI) Also a minimum: it can raise the project's major, never lower it.
global.json SDK pin Exact, and wins over both (MSBuild runs inside the editor and must use that SDK).

The editor never runs below its own major. When a newer major is needed, the selector writes the editor's runtimeconfig re-pointed at that major under %LOCALAPPDATA%\stride\host and restarts through dotnet exec --runtimeconfig <file> ... --host-relaunched.

Game Studio

  • The check runs at startup and on every restart path (project selection, File > Open, File > New, reload, restart after a partial load), all through one restart helper that replays the original arguments.
  • A restarted editor is a dotnet.exe process. It gets a per-install taskbar identity and the Stride icon, so it does not show as ".NET Host", and no console window opens.

Asset compiler

  • The package ships Stride.AssetCompiler.runtimeconfig.template.json, written at build time by the SDK's own GenerateRuntimeConfigurationFiles task with every framework at {MAJOR}.0.0-0 and LatestMinor, so previews and releases of a major are both found.
  • Stride.AssetCompiler.targets compares the project's major with the compiler's. When the project's is newer, it fills {MAJOR} with one literal Replace, writes the file under obj/, and runs the compiler through dotnet exec --runtimeconfig. No JSON editing in MSBuild, no environment variable.
  • Compiler slave processes start on the same runtime as their parent.

Tools

RollForward=Major on Game Studio, the launcher, the CLI and the asset compiler.

Launcher and CLI

  • The runtime selector is shown only for editors that understand the choice, detected by a type-reference scan of the editor assembly, so older Stride versions never receive the new arguments. Its strings are localized.
  • Uninstalling a version detects a running editor, including one restarted through dotnet exec, through a per-install named mutex.
  • stride studio --framework is dropped for older editors. stride new and stride upgrade run the asset compiler on the session's major.

Also in this PR

  • Launcher: legacy target framework selector removed. It only mattered for Stride 4.0.1 (.NET Framework 4.7.2 or .NET 5 editor), and it was already broken: the launcher ignored the choice and always started the 4.7.2 editor. Not worth fixing for such an old release.
  • Launcher: recent projects open with the exact Stride version they reference when that version is installed (useful for dev builds), else with the installed version of the same major.minor, as before.
  • Launcher: uninstall fix. The package store now waits for the "still running" check before deleting files, and the dialog is shown on the UI thread. Before, the check did not block the deletion, and when it found a running process the launcher crashed.

Testing

  • Unit tests: 35 selector tests in Stride.Launcher.Tests (decision table, first-target-framework rule, global.json pin, explicit choice as a minimum, missing runtime and SDK messages, runtimeconfig rewrite, editor capability scan).
  • Manual, Windows, .NET 10 and .NET 11 RC 1: the scenarios above, from a local dev build and from an installed package, plus uninstall refused while a restarted editor is open, and stride studio with an older editor (beta6). Starting with only a newer .NET installed was checked with a small app using the same RollForward=Major setting, not with Game Studio itself.
  • Not tested: Linux, the asset compiler targets under Visual Studio's msbuild.exe, and the compiler slave path (no production command starts slaves today).

Known limitations

  • Game Studio runs on a newer .NET than it was built for when the project asks for it. This is the user's choice, so there is no "untested runtime" warning.
  • For a multi-targeting game, the first target framework decides, on every platform. This matches how the editor already picks the project to load.

xen2 added 10 commits September 15, 2026 17:49
…tor on, with a generated runtimeconfig relaunch

Also the per-install host instance mutex and the selector tests.
…rt primitive for every restart path

Also a per-install taskbar identity for the re-executed process, the runtime in the window and progress titles, and the runtime version in crash reports.
…ees a re-executed editor

Also: stride new/upgrade run the asset compiler on the session's major, the CLI locates the compiler dll instead of its apphost, and dev-redirect versions find the editor under bin/<Configuration>.
@xen2
xen2 force-pushed the feature/multitarget-future-tfm branch from 6137f81 to c14f209 Compare September 15, 2026 08:53
@xen2 xen2 added ci-enduser Run the end-user sample screenshot + packaging suite on this PR ci-editor Run the GameStudio editor screenshot suite on this PR labels Sep 15, 2026
@xen2
xen2 merged commit ec758d2 into stride3d:master Sep 16, 2026
47 checks passed
@xen2
xen2 deleted the feature/multitarget-future-tfm branch September 16, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-editor Run the GameStudio editor screenshot suite on this PR ci-enduser Run the end-user sample screenshot + packaging suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Target .NET STS Versions

1 participant