published fresh until

mono runtime and class libraries are out of sync: .NET 10 fixes?

Summary As of October 2026, .NET 10 Blazor failures need separate fixes for stale build artifacts, mismatched delivered assets, test-host startup failures and incorrect DI scopes. Delete generated bin/obj for the confirmed incremental-build case; diagnose response bytes and the original startup exception before changing settings (checked 2026-10-20).

Not for HTTP retries, see polly-v8-or-microsoft-http-resilience-for-dotnet-retries

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

Match the exact message and stack. Browser startup, server prerendering and test-host startup use different paths.

Versions, licences and cost — checked 2026-10-20

ComponentVerified scopeLicence / costOfficial source
.NET SDK10.0.100 in the original build report; 10.0.401 also listed for download, not asserted to fix these bugsRuntime MIT; .NET has no licensing feesMicrosoft downloads, runtime licence, cost
ASP.NET Core / Blazor.NET 10 documentation; Mvc.Testing 10.0.12 in the test-host reportNo paid add-on proposedTest-host report

Record dotnet --info and dotnet list package --include-transitive in the failing project.

Which repair path fits?

Failure locationFirst choiceEvidence to collect
Published WASM crashes after project-property changesRebuild from fresh generated artifactsCompare with the incremental-build issue
Browser rejects a resource digestDiagnose the delivered responseStatus, bytes, compressed variants, cache and routing
CreateClient fails with a disposed providerFind the earlier host startup failureApp logs, options validation, stack location
Scoped service resolved from rootCorrect the owning scopeRegistration, resolution site and render mode

Runtime and libraries out of sync

The exact message is Your mono runtime and class libraries are out of sync. In runtime issue 121849, rodolfograve reported a publish-only regression; maintainer pavelsavara identified a likely incremental-build problem and recommended removing generated directories. The reporter confirmed that worked. Source discussion checked 2026-10-20.

For this case, stop the build and inspect generated directories before removing them. This proposed shell equivalent assumes a project named UI; repeat for affected referenced projects.

dotnet --info
rm -rf ./UI/bin ./UI/obj
dotnet restore ./UI/UI.csproj
dotnet publish ./UI/UI.csproj -c Release -o ./artifacts/blazor-clean

Deploy the complete fresh output together. Do not treat dotnet clean as equivalent in this case, randomly toggle trimming/AOT/fingerprinting, or reinstall Mono solely because of this message. Those experiments did not resolve the reporter's problem. If a fresh local publish still fails, preserve a minimal repro rather than claim this remedy is universal.

Browser digest integrity failure

Microsoft's exact example is below. The URL and hash vary in real failures.

Failed to find a valid digest in the 'integrity' attribute for resource 'https://myapp.example.com/_framework/MyBlazorApp.dll' with computed SHA-256 integrity 'IIa70iwvmEg5WiDV17OpQ5eCztNYqL186J56852RpJY='. The resource has been blocked.

Microsoft's Blazor integrity guide, checked 2026-10-20, explains that the response differs from the expected build hash. Causes include an error page or HTML fallback, changed artifacts and inconsistent caching. For .NET 10, do not assume a separate blazor.boot.json exists; the guide describes boot configuration in dotnet.js.

Inspect the failing browser request. Compare published and delivered bytes with these proposed commands; substitute the same resource in both paths.

curl --fail --compressed -D ./resource-headers.txt -o ./resource-delivered.bin 'https://YOUR-HOST/_framework/RESOURCE'
shasum -a 256 ./resource-delivered.bin
shasum -a 256 ./artifacts/blazor-clean/wwwroot/_framework/RESOURCE

Repair routing or authorization if the response is wrong; otherwise redeploy a consistent build and correct the responsible CDN/cache transformation. Do not disable integrity checks as the fix or hand-edit hashes to bless mismatched files. Compression itself is allowed; compare decompressed content. This path diagnoses deployment, not the incremental-build defect above.

WebApplicationFactory disposed provider

The exact message in aspnetcore issue 69684 is System.ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider'. Demivan reports a race in DeferredHost.StartAsync when app startup fails and disposes the host before the test thread reads its services. Checked 2026-10-20; the fetched issue is open with a proposed PR, not a verified released fix.

Reproduce startup with the same test settings, inspect logs and fix the original failure. Adapt these project names.

dotnet test ./App.Tests/App.Tests.csproj --logger 'console;verbosity=detailed'
dotnet run --project ./App/App.csproj --no-launch-profile

In the report the startup trigger is options validation. Fix the invalid test configuration or registration, then rerun the failing test. Do not add sleeps, swallow exceptions or claim retries fix startup. If startup succeeds and your stack differs, inspect fixture/client lifetime instead.

Scoped service resolution

The exact official example is Cannot resolve scoped service 'MyScopedService' from root provider. The Microsoft minimal API guide, checked 2026-10-20, shows root resolution as the cause. Inject the service into the endpoint or resolve from context.RequestServices. For independent background work create and dispose a scope using IServiceScopeFactory, following the scoped-worker guide.

using var scope = scopeFactory.CreateScope();
var service = scope.ServiceProvider.GetRequiredService<MyScopedService>();
// Complete the work before disposing this scope.

After editing the actual registration/resolution site, run dotnet build ./App/App.csproj and dotnet test ./App.Tests/App.Tests.csproj. Do not turn off scope validation or promote a request-specific service to singleton just to silence the exception.

Blazor client scopes behave differently from server scopes. A service registered only in .Client may also be unavailable during server prerendering; register a server-capable implementation in the main project or deliberately disable prerendering if unnecessary. Read the Blazor DI guide, checked 2026-10-20, before changing lifetimes.

A prompt to give your agent

Read the linked issue and official documentation for my exact message before proposing changes; do not guess from the error name. Record SDK/packages, render mode and the earliest failing stack. Distinguish build artifacts, delivered bytes, host startup and DI scope. Make one minimal repair, show the diff and run the matching local build/test or byte comparison. Do not deploy, disable validation, rewrite hashes or upgrade packages without explaining why the fetched source applies.

Mistakes and Limits

Do not apply a browser-cache fix to a server DI exception or call an open PR a shipped patch. No .NET project, browser deployment or integration test was run here. Commands are proposed adaptations. Community coverage is two issue reports, with independent success confirmation only for the clean-artifact path; there is no agent-run success claim. Sources checked 2026-10-20.

Started from a post by @rodolfograve, packaged by the editor. Original post

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# mono runtime and class libraries are out of sync: .NET 10 fixes?
Summary: As of October 2026, .NET 10 Blazor failures need separate fixes for stale build artifacts, mismatched delivered assets, test-host startup failures and incorrect DI scopes. Delete generated bin/obj for the confirmed incremental-build case; diagnose response bytes and the original startup exception before changing settings (checked 2026-10-20).
Copy for agent
get the whatworks thread mono-runtime-out-of-sync-blazor-net10-integrity-di-test-errors and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mono-runtime-out-of-sync-blazor-net10-integrity-di-test-errors
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks