-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improve Diagnosability of SDK Resolve Failure #6391
Comments
I found the issue. Missing Thanks! |
This will be improved due to #6312 which will fail the build at least This documentation explains how to use MSBuild project SDKs: https://github.com/Microsoft/MSBuildSdks#how-can-i-use-these-sdks This does as well: https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2019#how-project-sdks-are-resolved
Its really hard to know that the reason that an SDK couldn't be resolved was because a version wasn't specified because each SDK resolver may or may not need a version. |
Besides that, logs should tell that it attempted to open |
I feel like an aspect of the original design of SDK resolvers was lost here: each resolver can fail to find an SDK, and that's fine because there's a chain of them and the next one might. But if none of them do, we should emit the errors from each resolver, which would help pinpoint this. I thought we had a preexisting bug for this but I can't find it now, so this is it. |
Possibly related: dotnet/sdk#18048. |
Microsoft.Build.Traversal SDK's inability to provide source of problematic project (even with -v diag) is a pain point when things stop working. While looking into .NET 10 change that broke community platform dotnet/runtime#105004 (comment), I noticed that the portion of diagnostics log show:
which doesn't say anything about which traversed node the project failed to restore. |
When running
msbuild
,dotnet build
ordotnet msbuild
in the project below, I get the error:Here's the project:
When running with
-v diag
, I've noticed that it does not attempt to install or restore the SDK.I don't know how to install that SDK manually either. Documentation at https://github.com/microsoft/MSBuildSdks and https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk doesn't explain how to install. They just say that restore is automatic.
I also attempted
-target:Restore
but it saysTarget "Restore" skipped. The target does not exist in the project and SkipNonexistentTargets is set to true.
msbuild version
dotnet installed SDKs
The problem happens when I select SDK
3.1.114
or5.0.202
. I confirm that in both cases it's searching the msbuild SDK on directoryC:\Program Files\dotnet\sdk\{dotnet-SDK-version}\Sdks\Microsoft.Build.Traversal\Sdk
, and it's not finding there because it does not exist.I don't know how to install the msbuild SDK manually or what to do to fix the environment.
The text was updated successfully, but these errors were encountered: