-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache global.json in NuGet SDK resolver #4380
Conversation
src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/GlobalJsonReader.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/NuGetSdkResolver.cs
Outdated
Show resolved
Hide resolved
Note to self, do not merge until dev targets 17.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just 1 comment.
src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/GlobalJsonReader.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/GlobalJsonReader.cs
Outdated
Show resolved
Hide resolved
f5af52f
to
1a86290
Compare
This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch. |
@zivkan do you want to review this again before I merge? |
src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/GlobalJsonReader.cs
Outdated
Show resolved
Hide resolved
The MSBuild SDK resolver APIs provide some state but it is not thread-safe. This results in the NuGet SDK resolver loading and parsing global.json N times in Visual Studio, once for solution load and once for every design time build. This change introduces a file cache based on path and last write time that is thread-safe. I also changed how global.json is parsed to help speed up the process. Fixes NuGet/Home#11450 Related to NuGet/Home#11443
Add more logging and exception handling Address feedback
2992502
to
6ff3429
Compare
Bug
Fixes: NuGet/Home#11450
Regression? No
Description
The MSBuild SDK resolver APIs provide some state but it is not thread-safe. This results in the NuGet SDK resolver loading and parsing global.json N times in Visual Studio, once for solution load and once for every design time build.
This change introduces a file cache based on path and last write time that is thread-safe.
I also changed how global.json is parsed to help speed up the process.
Related to NuGet/Home#11443 and NuGet/Home#11441
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation