Devolutions/UniGetUI · warning · InvalidOperationException

The current UniGetUI session cannot show a window.

Error message

The current UniGetUI session cannot show a window.

What it means

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.

Source

Thrown at src/UniGetUI.Interface.IpcApi/IpcServer.cs:500

                            "The application did not register an app-state provider."
                        ),
                    IpcJson.Options
                );
            }
            catch (InvalidOperationException ex)
            {
                context.Response.StatusCode = 400;
                await context.Response.WriteAsync(ex.Message);
            }
        }

        private async Task V3_ShowApp(HttpContext context)
        {
            await HandleCommandAsync(
                context,
                () =>
                    ShowAppHandler?.Invoke()
                    ?? throw new InvalidOperationException(
                        "The current UniGetUI session cannot show a window."
                    )
            );
        }

        private async Task V3_NavigateApp(HttpContext context)
        {
            await HandleCommandAsync(
                context,
                () =>
                    NavigateAppHandler?.Invoke(BuildAppNavigateRequest(context.Request))
                    ?? throw new InvalidOperationException(
                        "The current UniGetUI session cannot navigate application pages."
                    )
            );
        }

        private async Task V3_QuitApp(HttpContext context)

View on GitHub (pinned to 9b1d7d0eab)

Solutions

  1. Register ShowAppHandler on the IpcServer before Start()
  2. Check IpcAppInfo.CanShowWindow before calling show-app
  3. Use HeadlessIpcHost/GUI host rather than a bare server

Example fix

// before
await ShowAppAsync(); // handler null on custom host
// after
var info = await GetAppInfoAsync();
if (!info.CanShowWindow) return Result.Unsupported();
await ShowAppAsync();
Defensive patterns

Strategy: validation

Validate before calling

// Client side: gate on the capability the host already reports
var info = await GetAppInfoAsync();
if (!info.CanShowWindow)
    return Result.Unsupported("session cannot show a window");
await ShowAppAsync();

Prevention

When it happens

Trigger: Calling show-app on a partially-initialized or custom host that never set ShowAppHandler.

Common situations: Custom embed that skips window handlers; calling automation before handler wiring completes.

Related errors


AI-assisted analysis of Devolutions/UniGetUI@9b1d7d0eab (2026-08-13). Data as JSON: /api/errors/1528b9771812e153. Report an issue: GitHub.