Skip to content

Fix runfile cache location to survive dnx auto-pruning#60

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-dotnet-runfile-prune-issue
Closed

Fix runfile cache location to survive dnx auto-pruning#60
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-dotnet-runfile-prune-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 3, 2026

dnx (the .NET 10+ built-in tool runner) periodically prunes its working directories under %TEMP%. Because runfile cached downloaded repos under %TEMP%\dotnet\runfile\, those directories were being deleted mid-session, causing dotnet run to fail with a NullReferenceException in LockFile.GetTarget and a "path not found" error when MSBuild tried to enumerate files in the now-deleted directory.

Changes

  • RemoteRefExtensions.csGetTempRoot() now uses LocalApplicationData on all platforms instead of Path.GetTempPath() on Windows. This moves the cache from AppData\Local\Temp\dotnet\runfile\ to AppData\Local\dotnet\runfile\, outside dnx's cleanup scope. Linux/Mac already used LocalApplicationData; this aligns Windows with the same behaviour. Drops the now-unused RuntimeInformation/OSPlatform import.

  • RemoteRunner.csdotnet clean is now skipped when the obj/ directory doesn't exist. ExtractToAsync always deletes the entire temp directory before re-extracting, so obj/ is never present after a fresh extraction. Running dotnet clean against a directory with no obj/ can produce a corrupted project.assets.json, which then causes the same NullReferenceException on the next dotnet run.

Copilot AI changed the title [WIP] Fix error when dotnet runfile prunes unused directories Fix runfile cache location to survive dnx auto-pruning May 3, 2026
Copilot finished work on behalf of kzu May 3, 2026 20:08
Copilot AI requested a review from kzu May 3, 2026 20:08
@kzu
Copy link
Copy Markdown
Member

kzu commented May 4, 2026

Superseded by #62

@kzu kzu closed this May 4, 2026
@kzu kzu deleted the copilot/fix-dotnet-runfile-prune-issue branch May 4, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When dotnet runfile prunes unused dirs, we're failing on next run

2 participants