-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Plumb error messages from sdk resolution through hostfxr_resolve_sdk2 #3662
Comments
All the hosting layers already have a solution for this. In The The caller should always remember the previous writer (returned by the set function) and set it back once the operation is done. |
We don't have any handling like this for warnings, but we could add something if necessary. |
Oh, cool! I didn't know that was added. (I don't think it was there when hostfxr_resolve_sdk2 was added.) I will close this and replace it with two different ones:
I would say warnings are much lower priority. So we can do (2) first and see if we really need them. |
sdk resolution emits errors to stderr, which is sufficient for command line scenarios, but stderr is not captured by VS when resolving SDKs.
(Aside: For a long time, VS would not show the errors returned by an SDK resolver at all, but that was fixed as of VS 16.0)
As of now, the that is shown in VS when sdk resolution fails is overly generic:
https://github.com/dotnet/cli/blob/6b0885139c1f37093ba4d3797f46fe90bf093883/src/Microsoft.DotNet.MSBuildSdkResolver/Strings.resx#L133
Proposed solution:
Add keys for error and warning to https://github.com/dotnet/core-setup/blob/1a10af88e3904b1d9790be38450c23eea683d6ae/src/corehost/cli/fxr/hostfxr.cpp#L141-L145
Change sdk resolver to retain the errors and warnings that are logged only to stderr, and hand them back to callers of hostfxr_resolve_sdk2
Change msbuild sdk resolver to return these back to msbuild / VS.
https://github.com/dotnet/cli/blob/6b0885139c1f37093ba4d3797f46fe90bf093883/src/Microsoft.DotNet.MSBuildSdkResolver/NETCoreSdkResolver.cs#L25
cc @peterhuene @vitek-karas @KathleenDollard
The text was updated successfully, but these errors were encountered: