# MentorUiScannerExtensions class

> The MentorUiScannerExtensions class of Novior.MentorAgent.Scanner: Story 1636 — registers the scan of the pages.

- URL: https://docs.mentoragent.net/api/novior-mentoragent-scanner/mentoruiscannerextensions
- Verified with: MentorAgent 1.5.0
- Last updated: 2026-11-26
- Packages: Novior.MentorAgent.Scanner

Story 1636 — registers the scan of the pages.

## Definition

Namespace: `Novior.MentorAgent.Scanner`. Package: `Novior.MentorAgent.Scanner`.

`public static class MentorUiScannerExtensions`

```shell
dotnet add package Novior.MentorAgent.Scanner
```

## Methods

### `AddMentorUiScanner`

`public static IServiceCollection AddMentorUiScanner(this IServiceCollection services, Action<MentorUiScannerOptions>? configure = null)`

Registers the scan of the pages: once the application has started, in `Development` only, it opens each page of the application in the Edge or Chrome already installed and writes what the page offers to the project's `mentor-ui-manifest.json`, which the AutoMentor reads at the next build. Outside `Development` it does nothing. Reference the package in Debug only, and call this under `#if DEBUG`; it needs `AddMentorAgent()` with `AutoMentor.Enabled`.

### `StartMentorUiScan`

`public static IServiceProvider StartMentorUiScan(this IServiceProvider services)`

Starts the scan of the pages in a .NET MAUI Blazor Hybrid app on Windows, where no host starts it: call it on `MauiApp.Services` right after `builder.Build()`, under `#if DEBUG`, before the app's window is created. In a Debug build of the app only, it opens the DevTools port of the app's WebView2 on the loopback (or uses the one `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS` already names, and the log says which), then reads each page in the app's window, as the app's own user, and returns to the page it found. The port stays open until the app closes. The scan clicks as the app's user: use it only with a build that points to development data. It needs [`MentorUiScannerExtensions.AddMentorUiScanner`](https://docs.mentoragent.net/api/novior-mentoragent-scanner/mentoruiscannerextensions#addmentoruiscanner); in a web host it does nothing, since the scan starts by itself.

---

- Previous: [Declarative.ServiceCollectionExtensions](https://docs.mentoragent.net/api/novior-mentoragent-declarative/servicecollectionextensions.md)
- Next: [MentorUiScannerOptions class](https://docs.mentoragent.net/api/novior-mentoragent-scanner/mentoruiscanneroptions.md)
