Skip to content
Latchkey

Blazor "Could not find a part of the path ... _framework" in CI

Blazor WebAssembly publish writes the runtime and assemblies into a wwwroot/_framework folder. When a deploy or zip step looks there and the publish wrote elsewhere (or failed earlier), you get "Could not find a part of the path ..._framework".

What this error means

A step after publish (copy, zip, or upload) fails with "Could not find a part of the path '.../wwwroot/_framework'" because the expected publish output is not where the step expects.

dotnet
System.IO.DirectoryNotFoundException: Could not find a part of the path
'/home/runner/work/app/app/bin/Release/net8.0/publish/wwwroot/_framework'.

Common causes

The publish output path differs from the deploy path

The deploy step hardcodes a path that does not match the actual --output of dotnet publish, so _framework is not there.

Publish failed or was skipped earlier

An earlier non-fatal warning let the job continue, but publish never produced _framework, so the next step cannot find it.

How to fix it

Publish to an explicit output and reuse it

  1. Publish with an explicit --output directory.
  2. Reference that same directory in the deploy or zip step.
  3. Confirm wwwroot/_framework exists before continuing.
.github/workflows/ci.yml
- run: dotnet publish -c Release -o ./publish
- run: test -d ./publish/wwwroot/_framework

Fail fast if publish did not produce output

Add a guard so a missing _framework folder fails the step with a clear message instead of a path error later.

Terminal
ls -la ./publish/wwwroot/_framework || exit 1

How to prevent it

  • Use one --output path for publish and downstream steps.
  • Verify the publish output exists before deploy or upload.
  • Do not let earlier warnings be treated as a successful publish.

Frequently asked questions

What causes ""Could not find a part of the path ..._framework""?
The deploy step hardcodes a path that does not match the actual --output of dotnet publish, so _framework is not there.
How do I fix "Could not find a part of the path ..._framework"?
Publish to an explicit output and reuse it

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card