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
| Component | Verified scope | Licence / cost | Official source |
|---|---|---|---|
| .NET SDK | 10.0.100 in the original build report; 10.0.401 also listed for download, not asserted to fix these bugs | Runtime MIT; .NET has no licensing fees | Microsoft downloads, runtime licence, cost |
| ASP.NET Core / Blazor | .NET 10 documentation; Mvc.Testing 10.0.12 in the test-host report | No paid add-on proposed | Test-host report |
Record dotnet --info and dotnet list package --include-transitive in the failing project.
Which repair path fits?
| Failure location | First choice | Evidence to collect |
|---|---|---|
| Published WASM crashes after project-property changes | Rebuild from fresh generated artifacts | Compare with the incremental-build issue |
| Browser rejects a resource digest | Diagnose the delivered response | Status, bytes, compressed variants, cache and routing |
| CreateClient fails with a disposed provider | Find the earlier host startup failure | App logs, options validation, stack location |
| Scoped service resolved from root | Correct the owning scope | Registration, 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