-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Record information about the resolved global.json usage in the SdkResolver #30711
Comments
From the source code, it looks like MSBuildSdkResolver already adds the path of global.json to SdkResult: sdk/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs Lines 170 to 171 in 517aa20
And MSBuild converts the contents of PropertiesToAdd to MSBuild properties: What seems to be missing is (1) a property or an item for the requested SDK version, and (2) logging of the results. |
Hey, I'm trying to find a documentation about how the SDK global.json is resolved and can only find the following code: sdk/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs Lines 215 to 234 in 517aa20
Do I understand correctly that if we pass a |
@xoofx yes, that's correct. The comment notes that the CurrentDirectory backstop is for evaluating in-memory projects only. |
in dotnet/msbuild#9621 the MSBuild team added logging of all resolution results, so that covers quite a bit. The only part missing from this is the requested version, if any, from the global.json. |
This is a good candidate for domestic cat to pick up. |
Is your feature request related to a problem? Please describe.
The SDK Resolver resolves an SDK according to any global.json rules that the .NET Host finds, and the Host reports back information like the path to the global.json, the version requested by the global.json, etc.
We should ensure that the SDK resolver logs this information via MSBuild properties to aid debugging - internal MSBuild users have been stumped by why a particular SDK was chosen when global.jsons far above the project root were at fault.
Describe the solution you'd like
We should log properties (or a single item with metadata) that provide the following data from the SDK Resolver:
This would make it easier for people debugging a build to determine if a global.json is impacting the build unexpectedly.
The text was updated successfully, but these errors were encountered: