Creator · managedcode
Last updated · Sep 3, 2026
Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.se
Creator · managedcode
Last updated · Sep 3, 2026
Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.se
Creator · managedcode
Last updated · Sep 3, 2026
Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.se
Creator · managedcode
Last updated · Sep 3, 2026
Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.se
Sandbox only
Install targets
Codex install prompt
Install the "convert-blazor-server-to-webapp" agent skill from https://github.com/managedcode/dotnet-skills/tree/main/catalog/Frameworks/Official-DotNet-ASPNetCore/skills/convert-blazor-server-to-webapp. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.server.js with blazor.web.js, migrating CascadingAuthenticationState to a service, adopting new Blazor Web App features like enhanced navigation and streaming rendering. DO NOT USE FOR: apps that are already Blazor Web Apps (already use AddRazorComponents and MapRazorComponents), Blazor WebAssembly or hosted Blazor WebAssembly apps (different migration path), apps that should stay on the Blazor Server hosting model without converting, or apps still targeting .NET Framework. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"managedcode-convert-blazor-server-to-webapp","task":"Install convert-blazor-server-to-webapp","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Testing and QA
I need my agent to test a web app, reproduce bugs, and verify fixes.
Agent fit
Claude Code + Browser agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Maintenance
fresh
6d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
477
73/100 Quality · 71/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
477 GitHub stars
Repo activity
477 stars, 33 forks
Maintenance
6d since push
License
MIT
Install
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webappDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/managedcode-convert-blazor-server-to-webapp/install
Agent should check
Copy prompt
Task: Use convert-blazor-server-to-webapp in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/managedcode-convert-blazor-server-to-webapp/install
Install command: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/managedcode-convert-blazor-server-to-webapp/install
LLM text format
/api/skills/managedcode-convert-blazor-server-to-webapp/install?format=text
Find alternatives
/api/skills/search?q=convert-blazor-server-to-webapp&limit=3
Agent prompt
Use convert-blazor-server-to-webapp for this task. Review https://www.openagentskill.com/api/skills/managedcode-convert-blazor-server-to-webapp/install, then install with: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webappRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/managedcode-convert-blazor-server-to-webapp
LLM text
/api/registry/manifest/managedcode-convert-blazor-server-to-webapp?format=text
Install alias
/api/registry/install/managedcode-convert-blazor-server-to-webapp
Recommend
/api/registry/recommend?task=Use%20convert-blazor-server-to-webapp%20in%20an%20agent%20workflow&limit=3
Agent fit
Browser automation
Use-case tags
Platforms
Claude Code, Browser agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Shortlist this skill and compare it with close alternatives before production adoption.
Role in stack
Companion skill
Primary fit
Browser automation
Trust label
Strong shortlist
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO477 GitHub stars
Stars/forks activity
CHECK477 stars, 33 forks; issue activity unavailable in current metadata
Recent maintenance
PASS6d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Workflow fit
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Scrape, clean, and reuse web data
A practical workflow for agents that crawl public pages, extract clean content, normalize data, and hand it to downstream research or RAG workflows.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: convert-blazor-server-to-webapp license: MIT description: > Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.server.js with blazor.web.js, migrating CascadingAuthenticationState to a service, adopting new Blazor Web App features like enhanced navigation and streaming rendering. DO NOT USE FOR: apps that are already Blazor Web Apps (already use AddRazorComponents and MapRazorComponents), Blazor WebAssembly or hosted Blazor WebAssembly apps (different migration path), apps that should stay on the Blazor Server hosting model without converting, or apps still targeting .NET Framework. ---
# Convert Blazor Server App to Blazor Web App
This skill helps an agent convert a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. The old hosting model uses `AddServerSideBlazor`/`MapBlazorHub` with a `_Host.cshtml` Razor Page as the entry point. The new Blazor Web App model uses `AddRazorComponents`/`MapRazorComponents` with an `App.razor` root component, enabling per-component render modes, enhanced navigation, streaming rendering, and other .NET 8+ features. The converted app uses `InteractiveServer` render mode to preserve existing interactive behavior.
## When to Use
- Migrating a Blazor Server app from .NET 6 or .NET 7 to .NET 8+ - App currently uses `AddServerSideBlazor()` and `MapBlazorHub()` in `Program.cs` (or `Startup.cs`) - App uses `Pages/_Host.cshtml` (or `_Host.razor`) as the host page with Component Tag Helpers - Want to adopt new Blazor Web App features while keeping interactive server rendering
## When Not to Use
- **The app already uses `AddRazorComponents` and `MapRazorComponents`.** It is already a Blazor Web App — no conversion is needed. Stop here and tell the user the app is already using the Blazor Web App model. - Blazor WebAssembly or hosted Blazor WebAssembly app — these have a different migration path - The app should stay on the legacy Blazor Server hosting model (just update TFM and packages) - The app targets .NET Framework — it must be migrated to .NET first
## Inputs
| Input | Required | Description | |-------|----------|-------------| | Blazor Server project | Yes | The `.csproj` and source files of the Blazor Server app | | Target framework | Yes | .NET 8 or later (e.g., `net8.0`, `net9.0`, `net10.0`) | | `Program.cs` or `Startup.cs` | Yes | The app's service and middleware configuration | | `_Host.cshtml` location | Recommended | Usually `Pages/_Host.cshtml`; may be `_Host.razor` in some projects |
## Workflow
> **Commit strategy:** Commit after each logical step so the migration is reviewable and bisectable.
### Step 1: Update the project file
Update the `.csproj` file:
1. Change the Target Framework Moniker (TFM) to the target version: ```xml <TargetFramework>net8.0</TargetFramework> ``` 2. Update all `Microsoft.AspNetCore.*`, `Microsoft.EntityFrameworkCore.*`, `Microsoft.Extensions.*`, and `System.Net.Http.Json` package references to the matching version.
For non-Blazor project file changes (nullable reference types, implicit usings, HTTP/3 support, etc.), see the [general ASP.NET Core migration guide](https://learn.microsoft.com/aspnet/core/migration/70-to-80).
### Step 2: Create `Routes.razor` from `App.razor`
The old `App.razor` contains the `<Router>` component. This content moves to a new `Routes.razor` file so that `App.razor` can become the root HTML document component.
1. Create a new file `Routes.razor` in the project root. 2. Move the entire content of `App.razor` into `Routes.razor`. 3. If the content is wrapped in `<CascadingAuthenticationState>`, remove that wrapper (it will be replaced by a service in Step 5). 4. Leave `App.razor` empty for the next step.
The resulting `Routes.razor` should look similar to:
```razor <Router AppAssembly="@typeof(Program).Assembly"> <Found Context="routeData"> <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> <FocusOnNavigate RouteData="@routeData" Selector="h1" /> </Found> <NotFound> <LayoutView Layout="@typeof(MainLayout)"> <p>Sorry, there's nothing at this address.</p> </LayoutView> </NotFound> </Router> ```
If the app uses `<AuthorizeRouteView>` instead of `<RouteView>`, keep it — it works the same way in Blazor Web Apps.
### Step 3: Convert `_Host.cshtml` to `App.razor`
Move the HTML shell from `Pages/_Host.cshtml` into the now-empty `App.razor` and transform it from a Razor Page into a Razor component:
1. **Remove Razor Page directives** — delete `@page "/"`, `@using Microsoft.AspNetCore.Components.Web`, `@namespace`, and `@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers`.
2. **Add component injection** — if using environment-conditional error UI, add: ```razor @inject IHostEnvironment Env ```
3. **Fix the base tag** — replace `<base href="~/" />` with `<base href="/" />`.
4. **Replace HeadOutlet Component Tag Helper** — replace: ```html <component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" /> ``` with: ```razor <HeadOutlet @rendermode="InteractiveServer" /> ```
5. **Replace App Component Tag Helper with Routes** — replace: ```html <component type="typeof(App)" render-mode="ServerPrerendered" /> ``` with: ```razor <Routes @rendermode="InteractiveServer" /> ```
6. **Replace Environment Tag Helpers** — replace: ```html <environment include="Staging,Production"> An error has occurred. This application may no longer respond until reloaded. </environment> <environment include="Development"> An unhandled exception has occurred. See browser dev tools for details. </environment> ``` with: ```razor @if (Env.IsDevelopment()) { <text> An unhandled exception has occurred. See browser dev tools for details. </text> } else { <text> An error has occurred. This app may no longer respond until reloaded. </text> } ```
7. **Update the Blazor script** — replace: ```html <script src="_framework/blazor.server.js"></script> ``` with: ```html <script src="_framework/blazor.web.js"></script> ```
8. **Add render mode import** — add to `_Imports.razor`: ```razor @using static Microsoft.AspNetCore.Components.Web.RenderMode ```
9. **Delete `Pages/_Host.cshtml`** (and `Pages/_Host.cshtml.cs` if it exists).
**Prerendering note:** If the original app used `render-mode="Server"` (not `"ServerPrerendered"`), prerendering was disabled. Preserve this by using `new InteractiveServerRenderMode(prerender: false)` instead of `InteractiveServer` for both `HeadOutlet` and `Routes`.
### Step 4: Update `Program.cs`
Make the following changes to `Program.cs` (or `Startup.cs` if the app uses the older hosting pattern):
1. **Replace Blazor Server services** — replace: ```csharp builder.Services.AddServerSideBlazor(); ``` with: ```csharp builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); ```
If `AddServerSideBlazor` had options configured (e.g., circuit options, hub options, detailed errors), migrate them to `AddInteractiveServerComponents`: ```csharp // Old: builder.Services.AddServerSideBlazor(options => { options.DetailedErrors = true; options.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(10); });
// New: builder.Services.AddRazorComponents() .AddInteractiveServerComponents(options => { options.DetailedErrors = true; options.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(10); }); ```
2. **Replace Blazor endpoint mapping** — replace: ```csharp app.MapBlazorHub(); ``` with: ```csharp app.MapRazorComponents<App>() .AddInteractiveServerRenderMode(); ```
Ensure there is a `using` statement for the project's root namespace so that `App` resolves to the `App.razor` component.
3. **Remove the fallback route** — delete: ```csharp app.MapFallbackToPage("/_Host"); ```
4. **Remove explicit routing middleware** — delete if present: ```csharp app.UseRouting(); ``` Endpoint routing is the default and explicit `UseRouting()` is no longer needed.
5. **Add antiforgery middleware** — add after `UseAuthentication`/`UseAuthorization` if present: ```csharp app.UseAntiforgery(); ``` `AddRazorComponents` registers antiforgery services automatically, but the middleware must be explicitly added to the pipeline. Without it, form POST requests fail with 400 errors.
### Step 5: Migrate `CascadingAuthenticationState` (if present)
If the app used `<CascadingAuthenticationState>` to wrap the router:
1. Remove the `<CascadingAuthenticationState>` component wrapper (already done in Step 2 if following this workflow). 2. Add the cascading authentication state service in `Program.cs`: ```csharp builder.Services.AddCascadingAuthenticationState(); ```
The component wrapper approach does not work across render mode boundaries in Blazor Web Apps. The service-based approach provides `Task<AuthenticationState>` as a cascading value to all components regardless of render mode.
### Step 6: Recommended improvements (optional)
These are optional modernization improvements — not required for the conversion to work. If you suggest any of these, state explicitly that they are optional.
- **Replace `UseStaticFiles` with `MapStaticAssets`** (.NET 9+): `app.MapStaticAssets()` provides optimized static file serving with fingerprinting, pre-compression, and content-based ETags. See [MapStaticAssets documentation](https://learn.microsoft.com/aspnet/core/fundamentals/static-files#mapstaticassets). - **Add `@attribute [StreamRendering]`** to pages with async data loading (`OnInitializedAsync`) for improved perceived performance. The page renders its initial synchronous content immediately and re-renders when async data arrives. - **Update CSS isolation bundle reference** if the `<link>` tag referenced a `_Host` assembly name; ensure it matches the project's actual assembly name: `<link href="{AssemblyName}.styles.css" rel="stylesheet" />`. - For other non-Blazor improvements (minimal hosting, HTTP/3, output caching, etc.), see the [general ASP.NET Core migration guide](https://learn.microsoft.com/aspnet/core/migration/70-to-80).
### Step 7: Verify the migration
1. Build the project targeting the new framework. Confirm no compile errors. 2. Search for remaining references to removed APIs: - `AddServerSideBlazor` - `MapBlazorHub` - `MapFallbackToPage` - `blazor.server.js` - `_Host.cshtml` 3. Run the app and verify: - Pages load and render correctly - Interactive features work (forms, event handlers, SignalR circuits) - Navigation between pages works - Authentication and authorization flows work if present 4. Run existing tests.
## Validation
- [ ] No references to `AddServerSideBlazor` remain - [ ] No references to `MapBlazorHub` remain - [ ] No references to `MapFallbackToPage("/_Host")` remain - [ ] No references to `blazor.server.js` remain - [ ] `Pages/_Host.cshtml` has been deleted - [ ] `App.razor` serves as the root component with a full HTML document structure - [ ] `Routes.razor` contains the `<Router>` configuration - [ ] `Program.cs` uses `AddRazorComponents().AddInteractiveServerComponents()` - [ ] `Program.cs` uses `MapRazorComponents<App>().AddInteractiveServerRenderMode()` - [ ] `app.UseAntiforgery()` is present in the middleware pipeline - [ ] If the app used `<CascadingAuthenticationState>`, it has been replaced with `AddCascadingAuthenticationState()` service registration - [ ] App builds and runs successfully on the t
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for convert-blazor-server-to-webapp, ready for a manual X post.
convert-blazor-server-to-webapp: Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: m... 477 stars https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=x
Listing + install path for convert-blazor-server-to-webapp: https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=x Install: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to managedcode but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp/audit)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)managedcode
@managedcode
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsSandbox only
Install targets
Codex install prompt
Install the "convert-blazor-server-to-webapp" agent skill from https://github.com/managedcode/dotnet-skills/tree/main/catalog/Frameworks/Official-DotNet-ASPNetCore/skills/convert-blazor-server-to-webapp. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.server.js with blazor.web.js, migrating CascadingAuthenticationState to a service, adopting new Blazor Web App features like enhanced navigation and streaming rendering. DO NOT USE FOR: apps that are already Blazor Web Apps (already use AddRazorComponents and MapRazorComponents), Blazor WebAssembly or hosted Blazor WebAssembly apps (different migration path), apps that should stay on the Blazor Server hosting model without converting, or apps still targeting .NET Framework. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"managedcode-convert-blazor-server-to-webapp","task":"Install convert-blazor-server-to-webapp","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Testing and QA
I need my agent to test a web app, reproduce bugs, and verify fixes.
Agent fit
Claude Code + Browser agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Maintenance
fresh
6d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
477
73/100 Quality · 71/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
477 GitHub stars
Repo activity
477 stars, 33 forks
Maintenance
6d since push
License
MIT
Install
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webappDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/managedcode-convert-blazor-server-to-webapp/install
Agent should check
Copy prompt
Task: Use convert-blazor-server-to-webapp in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/managedcode-convert-blazor-server-to-webapp/install
Install command: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/managedcode-convert-blazor-server-to-webapp/install
LLM text format
/api/skills/managedcode-convert-blazor-server-to-webapp/install?format=text
Find alternatives
/api/skills/search?q=convert-blazor-server-to-webapp&limit=3
Agent prompt
Use convert-blazor-server-to-webapp for this task. Review https://www.openagentskill.com/api/skills/managedcode-convert-blazor-server-to-webapp/install, then install with: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webappRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/managedcode-convert-blazor-server-to-webapp
LLM text
/api/registry/manifest/managedcode-convert-blazor-server-to-webapp?format=text
Install alias
/api/registry/install/managedcode-convert-blazor-server-to-webapp
Recommend
/api/registry/recommend?task=Use%20convert-blazor-server-to-webapp%20in%20an%20agent%20workflow&limit=3
Agent fit
Browser automation
Use-case tags
Platforms
Claude Code, Browser agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Shortlist this skill and compare it with close alternatives before production adoption.
Role in stack
Companion skill
Primary fit
Browser automation
Trust label
Strong shortlist
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO477 GitHub stars
Stars/forks activity
CHECK477 stars, 33 forks; issue activity unavailable in current metadata
Recent maintenance
PASS6d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Workflow fit
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Scrape, clean, and reuse web data
A practical workflow for agents that crawl public pages, extract clean content, normalize data, and hand it to downstream research or RAG workflows.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: convert-blazor-server-to-webapp license: MIT description: > Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.server.js with blazor.web.js, migrating CascadingAuthenticationState to a service, adopting new Blazor Web App features like enhanced navigation and streaming rendering. DO NOT USE FOR: apps that are already Blazor Web Apps (already use AddRazorComponents and MapRazorComponents), Blazor WebAssembly or hosted Blazor WebAssembly apps (different migration path), apps that should stay on the Blazor Server hosting model without converting, or apps still targeting .NET Framework. ---
# Convert Blazor Server App to Blazor Web App
This skill helps an agent convert a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. The old hosting model uses `AddServerSideBlazor`/`MapBlazorHub` with a `_Host.cshtml` Razor Page as the entry point. The new Blazor Web App model uses `AddRazorComponents`/`MapRazorComponents` with an `App.razor` root component, enabling per-component render modes, enhanced navigation, streaming rendering, and other .NET 8+ features. The converted app uses `InteractiveServer` render mode to preserve existing interactive behavior.
## When to Use
- Migrating a Blazor Server app from .NET 6 or .NET 7 to .NET 8+ - App currently uses `AddServerSideBlazor()` and `MapBlazorHub()` in `Program.cs` (or `Startup.cs`) - App uses `Pages/_Host.cshtml` (or `_Host.razor`) as the host page with Component Tag Helpers - Want to adopt new Blazor Web App features while keeping interactive server rendering
## When Not to Use
- **The app already uses `AddRazorComponents` and `MapRazorComponents`.** It is already a Blazor Web App — no conversion is needed. Stop here and tell the user the app is already using the Blazor Web App model. - Blazor WebAssembly or hosted Blazor WebAssembly app — these have a different migration path - The app should stay on the legacy Blazor Server hosting model (just update TFM and packages) - The app targets .NET Framework — it must be migrated to .NET first
## Inputs
| Input | Required | Description | |-------|----------|-------------| | Blazor Server project | Yes | The `.csproj` and source files of the Blazor Server app | | Target framework | Yes | .NET 8 or later (e.g., `net8.0`, `net9.0`, `net10.0`) | | `Program.cs` or `Startup.cs` | Yes | The app's service and middleware configuration | | `_Host.cshtml` location | Recommended | Usually `Pages/_Host.cshtml`; may be `_Host.razor` in some projects |
## Workflow
> **Commit strategy:** Commit after each logical step so the migration is reviewable and bisectable.
### Step 1: Update the project file
Update the `.csproj` file:
1. Change the Target Framework Moniker (TFM) to the target version: ```xml <TargetFramework>net8.0</TargetFramework> ``` 2. Update all `Microsoft.AspNetCore.*`, `Microsoft.EntityFrameworkCore.*`, `Microsoft.Extensions.*`, and `System.Net.Http.Json` package references to the matching version.
For non-Blazor project file changes (nullable reference types, implicit usings, HTTP/3 support, etc.), see the [general ASP.NET Core migration guide](https://learn.microsoft.com/aspnet/core/migration/70-to-80).
### Step 2: Create `Routes.razor` from `App.razor`
The old `App.razor` contains the `<Router>` component. This content moves to a new `Routes.razor` file so that `App.razor` can become the root HTML document component.
1. Create a new file `Routes.razor` in the project root. 2. Move the entire content of `App.razor` into `Routes.razor`. 3. If the content is wrapped in `<CascadingAuthenticationState>`, remove that wrapper (it will be replaced by a service in Step 5). 4. Leave `App.razor` empty for the next step.
The resulting `Routes.razor` should look similar to:
```razor <Router AppAssembly="@typeof(Program).Assembly"> <Found Context="routeData"> <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> <FocusOnNavigate RouteData="@routeData" Selector="h1" /> </Found> <NotFound> <LayoutView Layout="@typeof(MainLayout)"> <p>Sorry, there's nothing at this address.</p> </LayoutView> </NotFound> </Router> ```
If the app uses `<AuthorizeRouteView>` instead of `<RouteView>`, keep it — it works the same way in Blazor Web Apps.
### Step 3: Convert `_Host.cshtml` to `App.razor`
Move the HTML shell from `Pages/_Host.cshtml` into the now-empty `App.razor` and transform it from a Razor Page into a Razor component:
1. **Remove Razor Page directives** — delete `@page "/"`, `@using Microsoft.AspNetCore.Components.Web`, `@namespace`, and `@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers`.
2. **Add component injection** — if using environment-conditional error UI, add: ```razor @inject IHostEnvironment Env ```
3. **Fix the base tag** — replace `<base href="~/" />` with `<base href="/" />`.
4. **Replace HeadOutlet Component Tag Helper** — replace: ```html <component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" /> ``` with: ```razor <HeadOutlet @rendermode="InteractiveServer" /> ```
5. **Replace App Component Tag Helper with Routes** — replace: ```html <component type="typeof(App)" render-mode="ServerPrerendered" /> ``` with: ```razor <Routes @rendermode="InteractiveServer" /> ```
6. **Replace Environment Tag Helpers** — replace: ```html <environment include="Staging,Production"> An error has occurred. This application may no longer respond until reloaded. </environment> <environment include="Development"> An unhandled exception has occurred. See browser dev tools for details. </environment> ``` with: ```razor @if (Env.IsDevelopment()) { <text> An unhandled exception has occurred. See browser dev tools for details. </text> } else { <text> An error has occurred. This app may no longer respond until reloaded. </text> } ```
7. **Update the Blazor script** — replace: ```html <script src="_framework/blazor.server.js"></script> ``` with: ```html <script src="_framework/blazor.web.js"></script> ```
8. **Add render mode import** — add to `_Imports.razor`: ```razor @using static Microsoft.AspNetCore.Components.Web.RenderMode ```
9. **Delete `Pages/_Host.cshtml`** (and `Pages/_Host.cshtml.cs` if it exists).
**Prerendering note:** If the original app used `render-mode="Server"` (not `"ServerPrerendered"`), prerendering was disabled. Preserve this by using `new InteractiveServerRenderMode(prerender: false)` instead of `InteractiveServer` for both `HeadOutlet` and `Routes`.
### Step 4: Update `Program.cs`
Make the following changes to `Program.cs` (or `Startup.cs` if the app uses the older hosting pattern):
1. **Replace Blazor Server services** — replace: ```csharp builder.Services.AddServerSideBlazor(); ``` with: ```csharp builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); ```
If `AddServerSideBlazor` had options configured (e.g., circuit options, hub options, detailed errors), migrate them to `AddInteractiveServerComponents`: ```csharp // Old: builder.Services.AddServerSideBlazor(options => { options.DetailedErrors = true; options.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(10); });
// New: builder.Services.AddRazorComponents() .AddInteractiveServerComponents(options => { options.DetailedErrors = true; options.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(10); }); ```
2. **Replace Blazor endpoint mapping** — replace: ```csharp app.MapBlazorHub(); ``` with: ```csharp app.MapRazorComponents<App>() .AddInteractiveServerRenderMode(); ```
Ensure there is a `using` statement for the project's root namespace so that `App` resolves to the `App.razor` component.
3. **Remove the fallback route** — delete: ```csharp app.MapFallbackToPage("/_Host"); ```
4. **Remove explicit routing middleware** — delete if present: ```csharp app.UseRouting(); ``` Endpoint routing is the default and explicit `UseRouting()` is no longer needed.
5. **Add antiforgery middleware** — add after `UseAuthentication`/`UseAuthorization` if present: ```csharp app.UseAntiforgery(); ``` `AddRazorComponents` registers antiforgery services automatically, but the middleware must be explicitly added to the pipeline. Without it, form POST requests fail with 400 errors.
### Step 5: Migrate `CascadingAuthenticationState` (if present)
If the app used `<CascadingAuthenticationState>` to wrap the router:
1. Remove the `<CascadingAuthenticationState>` component wrapper (already done in Step 2 if following this workflow). 2. Add the cascading authentication state service in `Program.cs`: ```csharp builder.Services.AddCascadingAuthenticationState(); ```
The component wrapper approach does not work across render mode boundaries in Blazor Web Apps. The service-based approach provides `Task<AuthenticationState>` as a cascading value to all components regardless of render mode.
### Step 6: Recommended improvements (optional)
These are optional modernization improvements — not required for the conversion to work. If you suggest any of these, state explicitly that they are optional.
- **Replace `UseStaticFiles` with `MapStaticAssets`** (.NET 9+): `app.MapStaticAssets()` provides optimized static file serving with fingerprinting, pre-compression, and content-based ETags. See [MapStaticAssets documentation](https://learn.microsoft.com/aspnet/core/fundamentals/static-files#mapstaticassets). - **Add `@attribute [StreamRendering]`** to pages with async data loading (`OnInitializedAsync`) for improved perceived performance. The page renders its initial synchronous content immediately and re-renders when async data arrives. - **Update CSS isolation bundle reference** if the `<link>` tag referenced a `_Host` assembly name; ensure it matches the project's actual assembly name: `<link href="{AssemblyName}.styles.css" rel="stylesheet" />`. - For other non-Blazor improvements (minimal hosting, HTTP/3, output caching, etc.), see the [general ASP.NET Core migration guide](https://learn.microsoft.com/aspnet/core/migration/70-to-80).
### Step 7: Verify the migration
1. Build the project targeting the new framework. Confirm no compile errors. 2. Search for remaining references to removed APIs: - `AddServerSideBlazor` - `MapBlazorHub` - `MapFallbackToPage` - `blazor.server.js` - `_Host.cshtml` 3. Run the app and verify: - Pages load and render correctly - Interactive features work (forms, event handlers, SignalR circuits) - Navigation between pages works - Authentication and authorization flows work if present 4. Run existing tests.
## Validation
- [ ] No references to `AddServerSideBlazor` remain - [ ] No references to `MapBlazorHub` remain - [ ] No references to `MapFallbackToPage("/_Host")` remain - [ ] No references to `blazor.server.js` remain - [ ] `Pages/_Host.cshtml` has been deleted - [ ] `App.razor` serves as the root component with a full HTML document structure - [ ] `Routes.razor` contains the `<Router>` configuration - [ ] `Program.cs` uses `AddRazorComponents().AddInteractiveServerComponents()` - [ ] `Program.cs` uses `MapRazorComponents<App>().AddInteractiveServerRenderMode()` - [ ] `app.UseAntiforgery()` is present in the middleware pipeline - [ ] If the app used `<CascadingAuthenticationState>`, it has been replaced with `AddCascadingAuthenticationState()` service registration - [ ] App builds and runs successfully on the t
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for convert-blazor-server-to-webapp, ready for a manual X post.
convert-blazor-server-to-webapp: Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: m... 477 stars https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=x
Listing + install path for convert-blazor-server-to-webapp: https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=x Install: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to managedcode but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp/audit)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)managedcode
@managedcode
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsSandbox only
Install targets
Codex install prompt
Install the "convert-blazor-server-to-webapp" agent skill from https://github.com/managedcode/dotnet-skills/tree/main/catalog/Frameworks/Official-DotNet-ASPNetCore/skills/convert-blazor-server-to-webapp. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.server.js with blazor.web.js, migrating CascadingAuthenticationState to a service, adopting new Blazor Web App features like enhanced navigation and streaming rendering. DO NOT USE FOR: apps that are already Blazor Web Apps (already use AddRazorComponents and MapRazorComponents), Blazor WebAssembly or hosted Blazor WebAssembly apps (different migration path), apps that should stay on the Blazor Server hosting model without converting, or apps still targeting .NET Framework. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"managedcode-convert-blazor-server-to-webapp","task":"Install convert-blazor-server-to-webapp","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Testing and QA
I need my agent to test a web app, reproduce bugs, and verify fixes.
Agent fit
Claude Code + Browser agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Maintenance
fresh
6d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
477
73/100 Quality · 71/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
477 GitHub stars
Repo activity
477 stars, 33 forks
Maintenance
6d since push
License
MIT
Install
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webappDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/managedcode-convert-blazor-server-to-webapp/install
Agent should check
Copy prompt
Task: Use convert-blazor-server-to-webapp in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/managedcode-convert-blazor-server-to-webapp/install
Install command: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/managedcode-convert-blazor-server-to-webapp/install
LLM text format
/api/skills/managedcode-convert-blazor-server-to-webapp/install?format=text
Find alternatives
/api/skills/search?q=convert-blazor-server-to-webapp&limit=3
Agent prompt
Use convert-blazor-server-to-webapp for this task. Review https://www.openagentskill.com/api/skills/managedcode-convert-blazor-server-to-webapp/install, then install with: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webappRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/managedcode-convert-blazor-server-to-webapp
LLM text
/api/registry/manifest/managedcode-convert-blazor-server-to-webapp?format=text
Install alias
/api/registry/install/managedcode-convert-blazor-server-to-webapp
Recommend
/api/registry/recommend?task=Use%20convert-blazor-server-to-webapp%20in%20an%20agent%20workflow&limit=3
Agent fit
Browser automation
Use-case tags
Platforms
Claude Code, Browser agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Shortlist this skill and compare it with close alternatives before production adoption.
Role in stack
Companion skill
Primary fit
Browser automation
Trust label
Strong shortlist
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO477 GitHub stars
Stars/forks activity
CHECK477 stars, 33 forks; issue activity unavailable in current metadata
Recent maintenance
PASS6d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Workflow fit
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Scrape, clean, and reuse web data
A practical workflow for agents that crawl public pages, extract clean content, normalize data, and hand it to downstream research or RAG workflows.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: convert-blazor-server-to-webapp license: MIT description: > Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.server.js with blazor.web.js, migrating CascadingAuthenticationState to a service, adopting new Blazor Web App features like enhanced navigation and streaming rendering. DO NOT USE FOR: apps that are already Blazor Web Apps (already use AddRazorComponents and MapRazorComponents), Blazor WebAssembly or hosted Blazor WebAssembly apps (different migration path), apps that should stay on the Blazor Server hosting model without converting, or apps still targeting .NET Framework. ---
# Convert Blazor Server App to Blazor Web App
This skill helps an agent convert a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. The old hosting model uses `AddServerSideBlazor`/`MapBlazorHub` with a `_Host.cshtml` Razor Page as the entry point. The new Blazor Web App model uses `AddRazorComponents`/`MapRazorComponents` with an `App.razor` root component, enabling per-component render modes, enhanced navigation, streaming rendering, and other .NET 8+ features. The converted app uses `InteractiveServer` render mode to preserve existing interactive behavior.
## When to Use
- Migrating a Blazor Server app from .NET 6 or .NET 7 to .NET 8+ - App currently uses `AddServerSideBlazor()` and `MapBlazorHub()` in `Program.cs` (or `Startup.cs`) - App uses `Pages/_Host.cshtml` (or `_Host.razor`) as the host page with Component Tag Helpers - Want to adopt new Blazor Web App features while keeping interactive server rendering
## When Not to Use
- **The app already uses `AddRazorComponents` and `MapRazorComponents`.** It is already a Blazor Web App — no conversion is needed. Stop here and tell the user the app is already using the Blazor Web App model. - Blazor WebAssembly or hosted Blazor WebAssembly app — these have a different migration path - The app should stay on the legacy Blazor Server hosting model (just update TFM and packages) - The app targets .NET Framework — it must be migrated to .NET first
## Inputs
| Input | Required | Description | |-------|----------|-------------| | Blazor Server project | Yes | The `.csproj` and source files of the Blazor Server app | | Target framework | Yes | .NET 8 or later (e.g., `net8.0`, `net9.0`, `net10.0`) | | `Program.cs` or `Startup.cs` | Yes | The app's service and middleware configuration | | `_Host.cshtml` location | Recommended | Usually `Pages/_Host.cshtml`; may be `_Host.razor` in some projects |
## Workflow
> **Commit strategy:** Commit after each logical step so the migration is reviewable and bisectable.
### Step 1: Update the project file
Update the `.csproj` file:
1. Change the Target Framework Moniker (TFM) to the target version: ```xml <TargetFramework>net8.0</TargetFramework> ``` 2. Update all `Microsoft.AspNetCore.*`, `Microsoft.EntityFrameworkCore.*`, `Microsoft.Extensions.*`, and `System.Net.Http.Json` package references to the matching version.
For non-Blazor project file changes (nullable reference types, implicit usings, HTTP/3 support, etc.), see the [general ASP.NET Core migration guide](https://learn.microsoft.com/aspnet/core/migration/70-to-80).
### Step 2: Create `Routes.razor` from `App.razor`
The old `App.razor` contains the `<Router>` component. This content moves to a new `Routes.razor` file so that `App.razor` can become the root HTML document component.
1. Create a new file `Routes.razor` in the project root. 2. Move the entire content of `App.razor` into `Routes.razor`. 3. If the content is wrapped in `<CascadingAuthenticationState>`, remove that wrapper (it will be replaced by a service in Step 5). 4. Leave `App.razor` empty for the next step.
The resulting `Routes.razor` should look similar to:
```razor <Router AppAssembly="@typeof(Program).Assembly"> <Found Context="routeData"> <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> <FocusOnNavigate RouteData="@routeData" Selector="h1" /> </Found> <NotFound> <LayoutView Layout="@typeof(MainLayout)"> <p>Sorry, there's nothing at this address.</p> </LayoutView> </NotFound> </Router> ```
If the app uses `<AuthorizeRouteView>` instead of `<RouteView>`, keep it — it works the same way in Blazor Web Apps.
### Step 3: Convert `_Host.cshtml` to `App.razor`
Move the HTML shell from `Pages/_Host.cshtml` into the now-empty `App.razor` and transform it from a Razor Page into a Razor component:
1. **Remove Razor Page directives** — delete `@page "/"`, `@using Microsoft.AspNetCore.Components.Web`, `@namespace`, and `@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers`.
2. **Add component injection** — if using environment-conditional error UI, add: ```razor @inject IHostEnvironment Env ```
3. **Fix the base tag** — replace `<base href="~/" />` with `<base href="/" />`.
4. **Replace HeadOutlet Component Tag Helper** — replace: ```html <component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" /> ``` with: ```razor <HeadOutlet @rendermode="InteractiveServer" /> ```
5. **Replace App Component Tag Helper with Routes** — replace: ```html <component type="typeof(App)" render-mode="ServerPrerendered" /> ``` with: ```razor <Routes @rendermode="InteractiveServer" /> ```
6. **Replace Environment Tag Helpers** — replace: ```html <environment include="Staging,Production"> An error has occurred. This application may no longer respond until reloaded. </environment> <environment include="Development"> An unhandled exception has occurred. See browser dev tools for details. </environment> ``` with: ```razor @if (Env.IsDevelopment()) { <text> An unhandled exception has occurred. See browser dev tools for details. </text> } else { <text> An error has occurred. This app may no longer respond until reloaded. </text> } ```
7. **Update the Blazor script** — replace: ```html <script src="_framework/blazor.server.js"></script> ``` with: ```html <script src="_framework/blazor.web.js"></script> ```
8. **Add render mode import** — add to `_Imports.razor`: ```razor @using static Microsoft.AspNetCore.Components.Web.RenderMode ```
9. **Delete `Pages/_Host.cshtml`** (and `Pages/_Host.cshtml.cs` if it exists).
**Prerendering note:** If the original app used `render-mode="Server"` (not `"ServerPrerendered"`), prerendering was disabled. Preserve this by using `new InteractiveServerRenderMode(prerender: false)` instead of `InteractiveServer` for both `HeadOutlet` and `Routes`.
### Step 4: Update `Program.cs`
Make the following changes to `Program.cs` (or `Startup.cs` if the app uses the older hosting pattern):
1. **Replace Blazor Server services** — replace: ```csharp builder.Services.AddServerSideBlazor(); ``` with: ```csharp builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); ```
If `AddServerSideBlazor` had options configured (e.g., circuit options, hub options, detailed errors), migrate them to `AddInteractiveServerComponents`: ```csharp // Old: builder.Services.AddServerSideBlazor(options => { options.DetailedErrors = true; options.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(10); });
// New: builder.Services.AddRazorComponents() .AddInteractiveServerComponents(options => { options.DetailedErrors = true; options.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(10); }); ```
2. **Replace Blazor endpoint mapping** — replace: ```csharp app.MapBlazorHub(); ``` with: ```csharp app.MapRazorComponents<App>() .AddInteractiveServerRenderMode(); ```
Ensure there is a `using` statement for the project's root namespace so that `App` resolves to the `App.razor` component.
3. **Remove the fallback route** — delete: ```csharp app.MapFallbackToPage("/_Host"); ```
4. **Remove explicit routing middleware** — delete if present: ```csharp app.UseRouting(); ``` Endpoint routing is the default and explicit `UseRouting()` is no longer needed.
5. **Add antiforgery middleware** — add after `UseAuthentication`/`UseAuthorization` if present: ```csharp app.UseAntiforgery(); ``` `AddRazorComponents` registers antiforgery services automatically, but the middleware must be explicitly added to the pipeline. Without it, form POST requests fail with 400 errors.
### Step 5: Migrate `CascadingAuthenticationState` (if present)
If the app used `<CascadingAuthenticationState>` to wrap the router:
1. Remove the `<CascadingAuthenticationState>` component wrapper (already done in Step 2 if following this workflow). 2. Add the cascading authentication state service in `Program.cs`: ```csharp builder.Services.AddCascadingAuthenticationState(); ```
The component wrapper approach does not work across render mode boundaries in Blazor Web Apps. The service-based approach provides `Task<AuthenticationState>` as a cascading value to all components regardless of render mode.
### Step 6: Recommended improvements (optional)
These are optional modernization improvements — not required for the conversion to work. If you suggest any of these, state explicitly that they are optional.
- **Replace `UseStaticFiles` with `MapStaticAssets`** (.NET 9+): `app.MapStaticAssets()` provides optimized static file serving with fingerprinting, pre-compression, and content-based ETags. See [MapStaticAssets documentation](https://learn.microsoft.com/aspnet/core/fundamentals/static-files#mapstaticassets). - **Add `@attribute [StreamRendering]`** to pages with async data loading (`OnInitializedAsync`) for improved perceived performance. The page renders its initial synchronous content immediately and re-renders when async data arrives. - **Update CSS isolation bundle reference** if the `<link>` tag referenced a `_Host` assembly name; ensure it matches the project's actual assembly name: `<link href="{AssemblyName}.styles.css" rel="stylesheet" />`. - For other non-Blazor improvements (minimal hosting, HTTP/3, output caching, etc.), see the [general ASP.NET Core migration guide](https://learn.microsoft.com/aspnet/core/migration/70-to-80).
### Step 7: Verify the migration
1. Build the project targeting the new framework. Confirm no compile errors. 2. Search for remaining references to removed APIs: - `AddServerSideBlazor` - `MapBlazorHub` - `MapFallbackToPage` - `blazor.server.js` - `_Host.cshtml` 3. Run the app and verify: - Pages load and render correctly - Interactive features work (forms, event handlers, SignalR circuits) - Navigation between pages works - Authentication and authorization flows work if present 4. Run existing tests.
## Validation
- [ ] No references to `AddServerSideBlazor` remain - [ ] No references to `MapBlazorHub` remain - [ ] No references to `MapFallbackToPage("/_Host")` remain - [ ] No references to `blazor.server.js` remain - [ ] `Pages/_Host.cshtml` has been deleted - [ ] `App.razor` serves as the root component with a full HTML document structure - [ ] `Routes.razor` contains the `<Router>` configuration - [ ] `Program.cs` uses `AddRazorComponents().AddInteractiveServerComponents()` - [ ] `Program.cs` uses `MapRazorComponents<App>().AddInteractiveServerRenderMode()` - [ ] `app.UseAntiforgery()` is present in the middleware pipeline - [ ] If the app used `<CascadingAuthenticationState>`, it has been replaced with `AddCascadingAuthenticationState()` service registration - [ ] App builds and runs successfully on the t
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for convert-blazor-server-to-webapp, ready for a manual X post.
convert-blazor-server-to-webapp: Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: m... 477 stars https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=x
Listing + install path for convert-blazor-server-to-webapp: https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=x Install: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to managedcode but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp/audit)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)managedcode
@managedcode
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsSandbox only
Install targets
Codex install prompt
Install the "convert-blazor-server-to-webapp" agent skill from https://github.com/managedcode/dotnet-skills/tree/main/catalog/Frameworks/Official-DotNet-ASPNetCore/skills/convert-blazor-server-to-webapp. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.server.js with blazor.web.js, migrating CascadingAuthenticationState to a service, adopting new Blazor Web App features like enhanced navigation and streaming rendering. DO NOT USE FOR: apps that are already Blazor Web Apps (already use AddRazorComponents and MapRazorComponents), Blazor WebAssembly or hosted Blazor WebAssembly apps (different migration path), apps that should stay on the Blazor Server hosting model without converting, or apps still targeting .NET Framework. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"managedcode-convert-blazor-server-to-webapp","task":"Install convert-blazor-server-to-webapp","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Testing and QA
I need my agent to test a web app, reproduce bugs, and verify fixes.
Agent fit
Claude Code + Browser agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Maintenance
fresh
6d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
477
73/100 Quality · 71/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
477 GitHub stars
Repo activity
477 stars, 33 forks
Maintenance
6d since push
License
MIT
Install
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webappDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/managedcode-convert-blazor-server-to-webapp/install
Agent should check
Copy prompt
Task: Use convert-blazor-server-to-webapp in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20convert-blazor-server-to-webapp%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/managedcode-convert-blazor-server-to-webapp/install
Install command: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/managedcode-convert-blazor-server-to-webapp/install
LLM text format
/api/skills/managedcode-convert-blazor-server-to-webapp/install?format=text
Find alternatives
/api/skills/search?q=convert-blazor-server-to-webapp&limit=3
Agent prompt
Use convert-blazor-server-to-webapp for this task. Review https://www.openagentskill.com/api/skills/managedcode-convert-blazor-server-to-webapp/install, then install with: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webappRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/managedcode-convert-blazor-server-to-webapp
LLM text
/api/registry/manifest/managedcode-convert-blazor-server-to-webapp?format=text
Install alias
/api/registry/install/managedcode-convert-blazor-server-to-webapp
Recommend
/api/registry/recommend?task=Use%20convert-blazor-server-to-webapp%20in%20an%20agent%20workflow&limit=3
Agent fit
Browser automation
Use-case tags
Platforms
Claude Code, Browser agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Shortlist this skill and compare it with close alternatives before production adoption.
Role in stack
Companion skill
Primary fit
Browser automation
Trust label
Strong shortlist
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO477 GitHub stars
Stars/forks activity
CHECK477 stars, 33 forks; issue activity unavailable in current metadata
Recent maintenance
PASS6d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Workflow fit
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Scrape, clean, and reuse web data
A practical workflow for agents that crawl public pages, extract clean content, normalize data, and hand it to downstream research or RAG workflows.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: convert-blazor-server-to-webapp license: MIT description: > Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting _Host.cshtml to an App.razor root component, replacing blazor.server.js with blazor.web.js, migrating CascadingAuthenticationState to a service, adopting new Blazor Web App features like enhanced navigation and streaming rendering. DO NOT USE FOR: apps that are already Blazor Web Apps (already use AddRazorComponents and MapRazorComponents), Blazor WebAssembly or hosted Blazor WebAssembly apps (different migration path), apps that should stay on the Blazor Server hosting model without converting, or apps still targeting .NET Framework. ---
# Convert Blazor Server App to Blazor Web App
This skill helps an agent convert a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. The old hosting model uses `AddServerSideBlazor`/`MapBlazorHub` with a `_Host.cshtml` Razor Page as the entry point. The new Blazor Web App model uses `AddRazorComponents`/`MapRazorComponents` with an `App.razor` root component, enabling per-component render modes, enhanced navigation, streaming rendering, and other .NET 8+ features. The converted app uses `InteractiveServer` render mode to preserve existing interactive behavior.
## When to Use
- Migrating a Blazor Server app from .NET 6 or .NET 7 to .NET 8+ - App currently uses `AddServerSideBlazor()` and `MapBlazorHub()` in `Program.cs` (or `Startup.cs`) - App uses `Pages/_Host.cshtml` (or `_Host.razor`) as the host page with Component Tag Helpers - Want to adopt new Blazor Web App features while keeping interactive server rendering
## When Not to Use
- **The app already uses `AddRazorComponents` and `MapRazorComponents`.** It is already a Blazor Web App — no conversion is needed. Stop here and tell the user the app is already using the Blazor Web App model. - Blazor WebAssembly or hosted Blazor WebAssembly app — these have a different migration path - The app should stay on the legacy Blazor Server hosting model (just update TFM and packages) - The app targets .NET Framework — it must be migrated to .NET first
## Inputs
| Input | Required | Description | |-------|----------|-------------| | Blazor Server project | Yes | The `.csproj` and source files of the Blazor Server app | | Target framework | Yes | .NET 8 or later (e.g., `net8.0`, `net9.0`, `net10.0`) | | `Program.cs` or `Startup.cs` | Yes | The app's service and middleware configuration | | `_Host.cshtml` location | Recommended | Usually `Pages/_Host.cshtml`; may be `_Host.razor` in some projects |
## Workflow
> **Commit strategy:** Commit after each logical step so the migration is reviewable and bisectable.
### Step 1: Update the project file
Update the `.csproj` file:
1. Change the Target Framework Moniker (TFM) to the target version: ```xml <TargetFramework>net8.0</TargetFramework> ``` 2. Update all `Microsoft.AspNetCore.*`, `Microsoft.EntityFrameworkCore.*`, `Microsoft.Extensions.*`, and `System.Net.Http.Json` package references to the matching version.
For non-Blazor project file changes (nullable reference types, implicit usings, HTTP/3 support, etc.), see the [general ASP.NET Core migration guide](https://learn.microsoft.com/aspnet/core/migration/70-to-80).
### Step 2: Create `Routes.razor` from `App.razor`
The old `App.razor` contains the `<Router>` component. This content moves to a new `Routes.razor` file so that `App.razor` can become the root HTML document component.
1. Create a new file `Routes.razor` in the project root. 2. Move the entire content of `App.razor` into `Routes.razor`. 3. If the content is wrapped in `<CascadingAuthenticationState>`, remove that wrapper (it will be replaced by a service in Step 5). 4. Leave `App.razor` empty for the next step.
The resulting `Routes.razor` should look similar to:
```razor <Router AppAssembly="@typeof(Program).Assembly"> <Found Context="routeData"> <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> <FocusOnNavigate RouteData="@routeData" Selector="h1" /> </Found> <NotFound> <LayoutView Layout="@typeof(MainLayout)"> <p>Sorry, there's nothing at this address.</p> </LayoutView> </NotFound> </Router> ```
If the app uses `<AuthorizeRouteView>` instead of `<RouteView>`, keep it — it works the same way in Blazor Web Apps.
### Step 3: Convert `_Host.cshtml` to `App.razor`
Move the HTML shell from `Pages/_Host.cshtml` into the now-empty `App.razor` and transform it from a Razor Page into a Razor component:
1. **Remove Razor Page directives** — delete `@page "/"`, `@using Microsoft.AspNetCore.Components.Web`, `@namespace`, and `@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers`.
2. **Add component injection** — if using environment-conditional error UI, add: ```razor @inject IHostEnvironment Env ```
3. **Fix the base tag** — replace `<base href="~/" />` with `<base href="/" />`.
4. **Replace HeadOutlet Component Tag Helper** — replace: ```html <component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" /> ``` with: ```razor <HeadOutlet @rendermode="InteractiveServer" /> ```
5. **Replace App Component Tag Helper with Routes** — replace: ```html <component type="typeof(App)" render-mode="ServerPrerendered" /> ``` with: ```razor <Routes @rendermode="InteractiveServer" /> ```
6. **Replace Environment Tag Helpers** — replace: ```html <environment include="Staging,Production"> An error has occurred. This application may no longer respond until reloaded. </environment> <environment include="Development"> An unhandled exception has occurred. See browser dev tools for details. </environment> ``` with: ```razor @if (Env.IsDevelopment()) { <text> An unhandled exception has occurred. See browser dev tools for details. </text> } else { <text> An error has occurred. This app may no longer respond until reloaded. </text> } ```
7. **Update the Blazor script** — replace: ```html <script src="_framework/blazor.server.js"></script> ``` with: ```html <script src="_framework/blazor.web.js"></script> ```
8. **Add render mode import** — add to `_Imports.razor`: ```razor @using static Microsoft.AspNetCore.Components.Web.RenderMode ```
9. **Delete `Pages/_Host.cshtml`** (and `Pages/_Host.cshtml.cs` if it exists).
**Prerendering note:** If the original app used `render-mode="Server"` (not `"ServerPrerendered"`), prerendering was disabled. Preserve this by using `new InteractiveServerRenderMode(prerender: false)` instead of `InteractiveServer` for both `HeadOutlet` and `Routes`.
### Step 4: Update `Program.cs`
Make the following changes to `Program.cs` (or `Startup.cs` if the app uses the older hosting pattern):
1. **Replace Blazor Server services** — replace: ```csharp builder.Services.AddServerSideBlazor(); ``` with: ```csharp builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); ```
If `AddServerSideBlazor` had options configured (e.g., circuit options, hub options, detailed errors), migrate them to `AddInteractiveServerComponents`: ```csharp // Old: builder.Services.AddServerSideBlazor(options => { options.DetailedErrors = true; options.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(10); });
// New: builder.Services.AddRazorComponents() .AddInteractiveServerComponents(options => { options.DetailedErrors = true; options.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(10); }); ```
2. **Replace Blazor endpoint mapping** — replace: ```csharp app.MapBlazorHub(); ``` with: ```csharp app.MapRazorComponents<App>() .AddInteractiveServerRenderMode(); ```
Ensure there is a `using` statement for the project's root namespace so that `App` resolves to the `App.razor` component.
3. **Remove the fallback route** — delete: ```csharp app.MapFallbackToPage("/_Host"); ```
4. **Remove explicit routing middleware** — delete if present: ```csharp app.UseRouting(); ``` Endpoint routing is the default and explicit `UseRouting()` is no longer needed.
5. **Add antiforgery middleware** — add after `UseAuthentication`/`UseAuthorization` if present: ```csharp app.UseAntiforgery(); ``` `AddRazorComponents` registers antiforgery services automatically, but the middleware must be explicitly added to the pipeline. Without it, form POST requests fail with 400 errors.
### Step 5: Migrate `CascadingAuthenticationState` (if present)
If the app used `<CascadingAuthenticationState>` to wrap the router:
1. Remove the `<CascadingAuthenticationState>` component wrapper (already done in Step 2 if following this workflow). 2. Add the cascading authentication state service in `Program.cs`: ```csharp builder.Services.AddCascadingAuthenticationState(); ```
The component wrapper approach does not work across render mode boundaries in Blazor Web Apps. The service-based approach provides `Task<AuthenticationState>` as a cascading value to all components regardless of render mode.
### Step 6: Recommended improvements (optional)
These are optional modernization improvements — not required for the conversion to work. If you suggest any of these, state explicitly that they are optional.
- **Replace `UseStaticFiles` with `MapStaticAssets`** (.NET 9+): `app.MapStaticAssets()` provides optimized static file serving with fingerprinting, pre-compression, and content-based ETags. See [MapStaticAssets documentation](https://learn.microsoft.com/aspnet/core/fundamentals/static-files#mapstaticassets). - **Add `@attribute [StreamRendering]`** to pages with async data loading (`OnInitializedAsync`) for improved perceived performance. The page renders its initial synchronous content immediately and re-renders when async data arrives. - **Update CSS isolation bundle reference** if the `<link>` tag referenced a `_Host` assembly name; ensure it matches the project's actual assembly name: `<link href="{AssemblyName}.styles.css" rel="stylesheet" />`. - For other non-Blazor improvements (minimal hosting, HTTP/3, output caching, etc.), see the [general ASP.NET Core migration guide](https://learn.microsoft.com/aspnet/core/migration/70-to-80).
### Step 7: Verify the migration
1. Build the project targeting the new framework. Confirm no compile errors. 2. Search for remaining references to removed APIs: - `AddServerSideBlazor` - `MapBlazorHub` - `MapFallbackToPage` - `blazor.server.js` - `_Host.cshtml` 3. Run the app and verify: - Pages load and render correctly - Interactive features work (forms, event handlers, SignalR circuits) - Navigation between pages works - Authentication and authorization flows work if present 4. Run existing tests.
## Validation
- [ ] No references to `AddServerSideBlazor` remain - [ ] No references to `MapBlazorHub` remain - [ ] No references to `MapFallbackToPage("/_Host")` remain - [ ] No references to `blazor.server.js` remain - [ ] `Pages/_Host.cshtml` has been deleted - [ ] `App.razor` serves as the root component with a full HTML document structure - [ ] `Routes.razor` contains the `<Router>` configuration - [ ] `Program.cs` uses `AddRazorComponents().AddInteractiveServerComponents()` - [ ] `Program.cs` uses `MapRazorComponents<App>().AddInteractiveServerRenderMode()` - [ ] `app.UseAntiforgery()` is present in the middleware pipeline - [ ] If the app used `<CascadingAuthenticationState>`, it has been replaced with `AddCascadingAuthenticationState()` service registration - [ ] App builds and runs successfully on the t
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for convert-blazor-server-to-webapp, ready for a manual X post.
convert-blazor-server-to-webapp: Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: m... 477 stars https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=x
Listing + install path for convert-blazor-server-to-webapp: https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=x Install: npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to managedcode but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp/audit)
[](https://www.openagentskill.com/skills/managedcode-convert-blazor-server-to-webapp?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)managedcode
@managedcode
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsPermission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness