pcpm doctor
Diagnose common environment issues.
pcpm doctor
pcpm doctor runs a battery of sanity checks against your
environment and reports any that fail. Use it when something
isn’t working and you don’t know why.
Checks
| Check | What it does |
|---|---|
dotnet-sdk | Detects the dotnet SDK, prints the version. |
dotnet-restore | Runs dotnet restore against a scratch project. |
store-integrity | Walks the store, verifies every hash. |
store-writable | Tries to write a small file into the store. |
feed-reachability | HEAD requests every feed in pcpm.json. |
feed-auth | If credentials are set, verifies them. |
lockfile-consistency | Validates the lockfile against CPM. |
msbuild-target | Verifies the pcpm.MsBuild target is reachable. |
Output
✓ dotnet-sdk 10.0.202
✓ dotnet-restore 0.4s
✓ store-integrity 4,231 packages, 0 hash mismatches
✓ store-writable ok
✓ feed-reachability nuget.org (200 OK)
✓ feed-auth nuget.org (no credentials needed)
✓ lockfile-consistency ok
✗ msbuild-target not found — install pcpm.MsBuild for build-time integration
1 issue found. See `pcpm doctor --fix` for repair options.
Options
| Flag | Effect |
|---|---|
--fix | Try to repair any issues that are auto-repairable. |
--json | Output as JSON. |
--quiet | Suppress passing checks; only show failures. |
Common fixes
pcpm doctor --fix can resolve:
- Missing
Directory.Packages.props(regenerates frompcpm.json). - Stale store entries with mismatched hashes (re-downloads).
- Missing
pcpm.MsBuildtarget (logs the install command; does not install it for you).
It does not fix:
- Network errors (you have to be online).
- Authentication errors (check your environment variables).
- A wrong
dotnetSDK version (rundotnet --list-sdksto see what you have).
See also
- Configuration — for setting feed credentials.