{"record":{"id":"1528b9771812e153","repo":"Devolutions/UniGetUI","slug":"the-current-unigetui-session-cannot-show-a-window","errorCode":null,"errorMessage":"The current UniGetUI session cannot show a window.","messagePattern":"The current UniGetUI session cannot show a window\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":400,"severity":"warning","filePath":"src/UniGetUI.Interface.IpcApi/IpcServer.cs","lineNumber":500,"sourceCode":"                            \"The application did not register an app-state provider.\"\n                        ),\n                    IpcJson.Options\n                );\n            }\n            catch (InvalidOperationException ex)\n            {\n                context.Response.StatusCode = 400;\n                await context.Response.WriteAsync(ex.Message);\n            }\n        }\n\n        private async Task V3_ShowApp(HttpContext context)\n        {\n            await HandleCommandAsync(\n                context,\n                () =>\n                    ShowAppHandler?.Invoke()\n                    ?? throw new InvalidOperationException(\n                        \"The current UniGetUI session cannot show a window.\"\n                    )\n            );\n        }\n\n        private async Task V3_NavigateApp(HttpContext context)\n        {\n            await HandleCommandAsync(\n                context,\n                () =>\n                    NavigateAppHandler?.Invoke(BuildAppNavigateRequest(context.Request))\n                    ?? throw new InvalidOperationException(\n                        \"The current UniGetUI session cannot navigate application pages.\"\n                    )\n            );\n        }\n\n        private async Task V3_QuitApp(HttpContext context)","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcServer.cs#L482-L518","documentation":"V3_ShowApp throws when ShowAppHandler is null: the session has no window-show capability registered. The GUI host registers a real handler; HeadlessIpcHost registers one that throws a headless-specific message; a null handler means an unwired/custom host.","triggerScenarios":"Calling show-app on a partially-initialized or custom host that never set ShowAppHandler.","commonSituations":"Custom embed that skips window handlers; calling automation before handler wiring completes.","solutions":["Register ShowAppHandler on the IpcServer before Start()","Check IpcAppInfo.CanShowWindow before calling show-app","Use HeadlessIpcHost/GUI host rather than a bare server"],"exampleFix":"// before\nawait ShowAppAsync(); // handler null on custom host\n// after\nvar info = await GetAppInfoAsync();\nif (!info.CanShowWindow) return Result.Unsupported();\nawait ShowAppAsync();","handlingStrategy":"validation","validationCode":"// Client side: gate on the capability the host already reports\nvar info = await GetAppInfoAsync();\nif (!info.CanShowWindow)\n    return Result.Unsupported(\"session cannot show a window\");\nawait ShowAppAsync();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read CanShowWindow from app-info before any window automation","Wire all capability handlers when constructing the server"],"tags":["ipc","automation","capability"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}