Skip to content

NuGetSdkResolver should not create NuGet scratch directory - #7805

Merged
zivkan merged 1 commit into
devfrom
dev-zivkan-sdk-resolver-temp-directory
Oct 21, 2026
Merged

zivkan merged 1 commit into
devfrom
dev-zivkan-sdk-resolver-temp-directory

Conversation

@zivkan

@zivkan zivkan commented Oct 20, 2026

Copy link
Copy Markdown
Member

Bug

Fixes: refactor

Description

The NuGetSdkResolver was using NuGetEnvironment.GetFolderPath(NuGetFolderPath.Temp), which gets the "NuGetScratch" directory, and it checks if it exists and creates it if not. However, the SDK resolver doesn't actually use the directory. So, don't use that API, to ensure the directory isn't created if it doesn't already exist.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests NuGetEnvironment creates the scratch directory only when using the default code path, not when the NUGET_SCRATCH environment variable is set. Therefore, we can't override the directory and write a test to validate it doesn't get created. If the default scratch directory already exists, another process (or a parallel test) might need it, so we can't delete it. Therefore, it's not feasible to test this change.
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. N/A

@zivkan
zivkan requested a review from a team as a code owner October 20, 2026 00:35
@zivkan
zivkan requested review from donnie-msft and jeffkl October 20, 2026 00:35
@zivkan
zivkan force-pushed the dev-zivkan-sdk-resolver-temp-directory branch from 5b4219c to ec57857 Compare October 20, 2026 23:41
@zivkan
zivkan merged commit 49e1671 into dev Oct 21, 2026
18 checks passed
@zivkan
zivkan deleted the dev-zivkan-sdk-resolver-temp-directory branch October 21, 2026 03:07
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.

3 participants