{"record":{"id":"55d6f95f43add5c7","repo":"stride3d/stride","slug":"could-not-find-type-gametypename-in-project-projectname","errorCode":null,"errorMessage":"Could not find type [{gameTypeName}] in project [{projectName}]","messagePattern":"Could not find type \\[(.+?)\\] in project \\[(.+?)\\]","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Debugger/Debugger/GameDebuggerTarget.cs","lineNumber":155,"sourceCode":"                return GameEnumerateTypesHelper().Select(x => x.FullName).ToList();\n            }\n        }\n\n        /// <inheritdoc/>\n        public void GameLaunch(string gameTypeName)\n        {\n            try\n            {\n                Log.Info($\"Running game with type {gameTypeName}\");\n\n                Type gameType;\n                lock (loadedAssemblies)\n                {\n                    gameType = GameEnumerateTypesHelper().FirstOrDefault(x => x.FullName == gameTypeName);\n                }\n\n                if (gameType == null)\n                    throw new InvalidOperationException($\"Could not find type [{gameTypeName}] in project [{projectName}]\");\n\n                game = (Game)Activator.CreateInstance(gameType);\n\n                // TODO: Bind database\n                Task.Run(() =>\n                {\n                    gameFinished.Reset();\n                    try\n                    {\n                        using (game)\n                        {\n                            // Allow scripts to crash, we will still restart them\n                            game.Script.Scheduler.PropagateExceptions = false;\n                            game.Run();\n                        }\n                    }\n                    catch (Exception e)\n                    {","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Debugger/Debugger/GameDebuggerTarget.cs#L137-L173","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the fully-qualified type name in the launch/debug configuration matches the actual class (namespace + name)","Update the project's startup/entry type in the Stride Game Studio (Package properties) after any rename","Rebuild the project so the assembly containing the type is loaded before enumeration","Check the type derives from Stride.Engine.Game and compiles into the launched project (not excluded by conditional compilation)"],"exampleFix":"// before (launch config)\n\"GameTypeName\": \"MyNamespace.MyGameOld\"\n// after\nclass MyGame : Game { } // namespace MyNamespace\n\"GameTypeName\": \"MyNamespace.MyGame\"","handlingStrategy":"try-catch","validationCode":"var loaded = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => { try { return a.GetTypes(); } catch { return Type.EmptyTypes; } });\nbool exists = loaded.Any(t => t.FullName == gameTypeName && typeof(Game).IsAssignableFrom(t));","typeGuard":"static bool IsLaunchableGameType(Type t) => t != null && !t.IsAbstract && typeof(Game).IsAssignableFrom(t);","tryCatchPattern":"try { Launch(...); } catch (InvalidOperationException ex) when (ex.Message.StartsWith(\"Could not find type\")) { logger.Error(ex, \"Check the game type name in launch settings\"); }","preventionTips":["Keep the launch-profile game type name in sync with renames of the Game class/namespace","Regenerate launch configurations from the Stride Game Studio rather than hand-editing","Ensure the project builds for the selected configuration/platform so the type is present in the loaded assembly","Verify the entry type derives from Stride.Engine.Game"],"tags":["debugger","type-resolution","stride"],"backgroundTag":"class-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}