# dotnet "NETSDK1004: Assets file project.assets.json not found" in CI

> Fix dotnet "error NETSDK1004: Assets file <path>/project.assets.json not found. Run a NuGet package restore" in CI - building with --no-restore before restore produced the assets file.

Source: https://latchkey.dev/learn/dotnet/build-netsdk1004-assets-file-not-found  
Updated: 2026-06-25

The build looked for `project.assets.json` (restore’s output that lists resolved packages) and it was not there. A build ran before restore, or with `--no-restore` when nothing had restored yet.

## Diagnose it: SDK version and restore first

Most .NET CI failures are an SDK mismatch or a restore that did not happen. `global.json` pins the SDK, and if the runner does not have that exact version the failure message is about the project rather than the SDK.

```Terminal
dotnet --info
cat global.json 2>/dev/null

# restore explicitly so a restore failure is not reported as a build failure
dotnet restore --verbosity normal
dotnet build --no-restore -warnaserror
```

> Pin the SDK with `global.json` and install exactly that version with `actions/setup-dotnet`. A floating SDK turns a runner image update into a build break on unchanged code.

## FAQ

### What causes dotnet "NETSDK1004: assets file project.assets.json not found" in CI?

There are 2 common causes: built with --no-restore before restoring and obj directory cleaned or not cached. A dotnet build --no-restore (or dotnet test --no-restore) ran before any dotnet restore, so obj/project.assets.json was never generated.

### How do I fix dotnet "NETSDK1004: assets file project.assets.json not found" in CI?

There are 2 fixes depending on which cause you have: restore before building and or drop --no-restore. Work through them in order, since the first is the most common.

### What does dotnet "NETSDK1004: assets file project.assets.json not found" in CI actually mean?

Build fails with NETSDK1004 saying the assets file was not found and to "Run a NuGet package restore".

### How do I stop dotnet "NETSDK1004: assets file project.assets.json not found" in CI happening again?

Always run dotnet restore before a --no-restore build/test. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
