{"record":{"id":"14544dcc96f53115","repo":"Devolutions/UniGetUI","slug":"the-current-unigetui-session-cannot-be-shut-down-t","errorCode":null,"errorMessage":"The current UniGetUI session cannot be shut down through automation.","messagePattern":"The current UniGetUI session cannot be shut down through automation\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":400,"severity":"warning","filePath":"src/UniGetUI.Interface.IpcApi/IpcServer.cs","lineNumber":524,"sourceCode":"        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)\n        {\n            await HandleCommandAsync(\n                context,\n                () =>\n                    QuitAppHandler?.Invoke()\n                    ?? throw new InvalidOperationException(\n                        \"The current UniGetUI session cannot be shut down through automation.\"\n                    )\n            );\n        }\n\n        private async Task V3_ListOperations(HttpContext context)\n        {\n            await HandleReadAsync(context, IpcOperationApi.ListOperations);\n        }\n\n        private async Task V3_GetOperation(HttpContext context)\n        {\n            await HandleReadAsync(\n                context,\n                () => IpcOperationApi.GetOperation(GetRequiredRouteValue(context, \"operationId\"))\n            );\n        }\n","sourceCodeStart":506,"sourceCodeEnd":542,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcServer.cs#L506-L542","documentation":"V3_QuitApp throws when QuitAppHandler is null: the session disallows automation-initiated shutdown. GUI and HeadlessIpcHost both register a real handler; null indicates an unconfigured host or a deliberate policy to block remote quit.","triggerScenarios":"Calling quit-app against a host whose QuitAppHandler was never set.","commonSituations":"Custom embed that does not wire quit; a security policy that intentionally leaves it null to prevent remote shutdown.","solutions":["Register QuitAppHandler before Start()","Check IpcAppInfo.CanQuit before calling quit-app","If remote shutdown must be blocked, leave it null and treat the error as expected"],"exampleFix":"// before\nawait QuitAppAsync();\n// after\nvar info = await GetAppInfoAsync();\nif (!info.CanQuit) return Result.Unsupported();\nawait QuitAppAsync();","handlingStrategy":"validation","validationCode":"var info = await GetAppInfoAsync();\nif (!info.CanQuit)\n    return Result.Unsupported(\"session cannot be shut down\");\nawait QuitAppAsync();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read CanQuit before quit automation","Decide deliberately whether to wire QuitAppHandler"],"tags":["ipc","automation","capability"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}