{"record":{"id":"e33b4aba6f678f9c","repo":"stride3d/stride","slug":"no-uitest-class-found-in-testdllpath","errorCode":null,"errorMessage":"No [UITest] class found in '{testDllPath}'.","messagePattern":"No \\[UITest\\] class found in '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/editor/Stride.GameStudio.AutoTesting/UITestHost.cs","lineNumber":156,"sourceCode":"        foreach (var win in app.Windows.OfType<Window>())\n        {\n            if (!win.IsVisible || !win.IsLoaded) continue;\n            if (win.ActualWidth < 100 || win.ActualHeight < 100) continue;\n            if (!ReadyWindowTypeNames.Contains(win.GetType().Name)) continue;\n            Log($\"ready: '{win.GetType().Name}' Title='{win.Title}' Size={win.ActualWidth}x{win.ActualHeight}\");\n            return true;\n        }\n        return false;\n    }\n\n    private IUITest LoadTest()\n    {\n        var asm = Assembly.LoadFrom(testDllPath);\n        var candidates = asm.GetTypes()\n            .Where(t => t.GetCustomAttribute<UITestAttribute>() is not null)\n            .ToList();\n        if (candidates.Count == 0)\n            throw new InvalidOperationException($\"No [UITest] class found in '{testDllPath}'.\");\n\n        Type chosen;\n        if (testClassName is not null)\n        {\n            chosen = candidates.FirstOrDefault(t => t.Name == testClassName || t.FullName == testClassName)\n                ?? throw new InvalidOperationException($\"No [UITest] class named '{testClassName}' in '{testDllPath}'. Available: {string.Join(\", \", candidates.Select(t => t.FullName))}\");\n        }\n        else if (candidates.Count == 1)\n        {\n            chosen = candidates[0];\n        }\n        else\n        {\n            throw new InvalidOperationException($\"Multiple [UITest] classes in '{testDllPath}'; pass --test-name to select. Available: {string.Join(\", \", candidates.Select(t => t.FullName))}\");\n        }\n\n        if (!typeof(IUITest).IsAssignableFrom(chosen))\n            throw new InvalidOperationException($\"[UITest] class {chosen.FullName} must implement IUITest.\");","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/editor/Stride.GameStudio.AutoTesting/UITestHost.cs#L138-L174","documentation":"UITestHost.LoadTest loads a test DLL and scans its types for the UITestAttribute. If no type in the assembly carries [UITest], it throws InvalidOperationException naming the DLL path. This validates that the supplied test assembly actually contains a runnable UI test.","triggerScenarios":"Running the auto-testing host with --test-dll pointing at an assembly that has no class annotated with [UITest].","commonSituations":"Pointing the tool at the wrong DLL (e.g. a game or engine assembly instead of the UITest project); building the test project without the attribute; an outdated DLL deployed next to the host.","solutions":["Point --test-dll at the assembly that contains your [UITest]-annotated class.","Add [UITest] to the test class in the test project and rebuild.","Rebuild/redeploy the test DLL so the deployed copy includes the annotated types.","Verify with a quick scan that the attribute is present (e.g. grep for [UITest] in the test project)."],"exampleFix":"// before\n// MyGameTests.cs has no attribute\npublic class MyGameTests : IUITest { ... }\n// after\n[UITest]\npublic class MyGameTests : IUITest { ... }","handlingStrategy":"validation","validationCode":"var asm = Assembly.LoadFrom(testDllPath);\nbool hasTest = asm.GetTypes().Any(t => t.GetCustomAttribute<UITestAttribute>() is not null);\nif (!hasTest) throw new InvalidOperationException($\"{testDllPath} contains no [UITest] class\");","typeGuard":null,"tryCatchPattern":"try { test = LoadTest(testDllPath, testName); }\ncatch (InvalidOperationException ex) { Console.Error.WriteLine(ex.Message); return 1; }","preventionTips":["Confirm the DLL is the built UITest project","Annotate the test class with [UITest]","Rebuild before running the host"],"tags":["testing","reflection","uitest"],"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-16T04:17:20.429Z"}