Skip to content
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 MSBuildWorkspace diagnostic reporting #75170

Open
tmat opened this issue Sep 19, 2024 · 0 comments
Open

Improve MSBuildWorkspace diagnostic reporting #75170

tmat opened this issue Sep 19, 2024 · 0 comments
Assignees
Labels
Milestone

Comments

@tmat
Copy link
Member

tmat commented Sep 19, 2024

MSBuildWorkspace.WorkspaceFailed reports WorkspaceDiagnosticKind.Failure even for issues that can be safely ignored, such as failure to load project of unregistered extension.

Internally, DiagnosticReporter.Report conflates logging with exception handling. It's unclear why DiagnosticReportingMode is needed.
Callers that pass DiagnosticReportingMode.Throw should just throw the exception directly.
Callers that pass DiagnosticReportingMode.Ignore should not call the method at all - it's a no op.

MSBuildWorkspace.WorkspaceFailed should be called with WorkspaceDiagnosticKind.Failure only for unrecoverable errors. Presumably, we wouldn't immediately throw in these cases so that we can report all the errors. Failure should be reported if and only if the operation fails. If the operation can succeed (e.g. by ignoring certain projects) a warning should be reported.

Update dotnet-watch once fixed - see dotnet/sdk#43571.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 19, 2024
@CyrusNajmabadi CyrusNajmabadi added the IDE-MSBuildWorkspace MSBuildWorkspace label Oct 25, 2024
@CyrusNajmabadi CyrusNajmabadi added this to the 17.13 milestone Nov 26, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged Issues and PRs which have not yet been triaged by a lead label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants