stride3d/stride · error · InvalidOperationException

Could not find type [{gameTypeName}] in project [{projectNam

Error message

Could not find type [{gameTypeName}] in project [{projectName}]

What it means

GameDebuggerTarget.GameLaunch tries to locate the game's entry type in the loaded assemblies of the debugged project using GameEnumerateTypesHelper, matching on FullName against gameTypeName. If no such type exists, it throws InvalidOperationException('Could not find type [type] in project [project]'). This indicates the debugger target launched a project whose Game-derived type could not be found, so a Game instance cannot be instantiated for debugging.

Solutions

  1. Verify the fully-qualified type name in the launch/debug configuration matches the actual class (namespace + name)
  2. Update the project's startup/entry type in the Stride Game Studio (Package properties) after any rename
  3. Rebuild the project so the assembly containing the type is loaded before enumeration
  4. Check the type derives from Stride.Engine.Game and compiles into the launched project (not excluded by conditional compilation)

Example fix

// before (launch config)
"GameTypeName": "MyNamespace.MyGameOld"
// after
class MyGame : Game { } // namespace MyNamespace
"GameTypeName": "MyNamespace.MyGame"
Defensive patterns

Strategy: try-catch

Validate before calling

var loaded = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => { try { return a.GetTypes(); } catch { return Type.EmptyTypes; } });
bool exists = loaded.Any(t => t.FullName == gameTypeName && typeof(Game).IsAssignableFrom(t));

Type guard

static bool IsLaunchableGameType(Type t) => t != null && !t.IsAbstract && typeof(Game).IsAssignableFrom(t);

Try / catch

try { Launch(...); } catch (InvalidOperationException ex) when (ex.Message.StartsWith("Could not find type")) { logger.Error(ex, "Check the game type name in launch settings"); }

Prevention

When it happens

Trigger: Launching the Stride game debugger with a gameTypeName (from project settings) that does not exist in the compiled project assemblies; the assembly not yet loaded or enumerated under the lock; namespace renamed so FullName no longer matches; main game class deleted or renamed after the launch profile was configured.

Common situations: Renaming the Game class or its namespace without updating the Stride launcher/debugger configuration; building a different configuration/platform where the type is excluded; stale project reference in the debugger target pointing at an outdated assembly.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/55d6f95f43add5c7. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.Debugger/Debugger/GameDebuggerTarget.cs:155

                return GameEnumerateTypesHelper().Select(x => x.FullName).ToList();
            }
        }

        /// <inheritdoc/>
        public void GameLaunch(string gameTypeName)
        {
            try
            {
                Log.Info($"Running game with type {gameTypeName}");

                Type gameType;
                lock (loadedAssemblies)
                {
                    gameType = GameEnumerateTypesHelper().FirstOrDefault(x => x.FullName == gameTypeName);
                }

                if (gameType == null)
                    throw new InvalidOperationException($"Could not find type [{gameTypeName}] in project [{projectName}]");

                game = (Game)Activator.CreateInstance(gameType);

                // TODO: Bind database
                Task.Run(() =>
                {
                    gameFinished.Reset();
                    try
                    {
                        using (game)
                        {
                            // Allow scripts to crash, we will still restart them
                            game.Script.Scheduler.PropagateExceptions = false;
                            game.Run();
                        }
                    }
                    catch (Exception e)
                    {

View on GitHub (pinned to 96fad776d2)