-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Propagate dotnet run-api errors more clearly #79445
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,7 +174,12 @@ private async ValueTask ReloadProjectsAsync(ImmutableSegmentedList<ProjectToLoad | |
| } | ||
| } | ||
|
|
||
| protected sealed record RemoteProjectLoadResult(RemoteProjectFile ProjectFile, ProjectSystemProjectFactory ProjectFactory, bool IsMiscellaneousFile, BuildHostProcessKind Preferred, BuildHostProcessKind Actual); | ||
| /// <param name="HasLoadErrors"> | ||
| /// Whether there were errors in the process of loading the project file itself. | ||
| /// When this is true, we may still want to proceed with design-time build in order to provide partial information about the project. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The semantics described here are a bit reversed of what I'd imagine we would do -- I would have expected 'true' means 'we know there are already errors, no reason to go further'. Is the easier approach here just to return a set of diagnostics that are concatenated onto the existing things that get reported? |
||
| /// When this is false, <see cref="RemoteProjectFile.GetDiagnosticLogItemsAsync"/> also needs to be separately checked, to decide if evaluation was successful. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A couple things
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| /// </param> | ||
| protected sealed record RemoteProjectLoadResult(RemoteProjectFile ProjectFile, ProjectSystemProjectFactory ProjectFactory, bool IsMiscellaneousFile, BuildHostProcessKind Preferred, BuildHostProcessKind Actual, bool HasLoadErrors); | ||
|
|
||
| /// <summary>Loads a project in the MSBuild host.</summary> | ||
| /// <remarks>Caller needs to catch exceptions to avoid bringing down the project loader queue.</remarks> | ||
|
|
@@ -209,7 +214,7 @@ private async Task<bool> ReloadProjectAsync(ProjectToLoad projectToLoad, ToastEr | |
| return false; | ||
| } | ||
|
|
||
| (RemoteProjectFile remoteProjectFile, ProjectSystemProjectFactory projectFactory, bool isMiscellaneousFile, BuildHostProcessKind preferredBuildHostKind, BuildHostProcessKind actualBuildHostKind) = remoteProjectLoadResult; | ||
| (RemoteProjectFile remoteProjectFile, ProjectSystemProjectFactory projectFactory, bool isMiscellaneousFile, BuildHostProcessKind preferredBuildHostKind, BuildHostProcessKind actualBuildHostKind, bool hasLoadErrors) = remoteProjectLoadResult; | ||
| if (preferredBuildHostKind != actualBuildHostKind) | ||
| preferredBuildHostKindThatWeDidNotGet = preferredBuildHostKind; | ||
|
|
||
|
|
@@ -289,7 +294,7 @@ private async Task<bool> ReloadProjectAsync(ProjectToLoad projectToLoad, ToastEr | |
| } | ||
|
|
||
| diagnosticLogItems = await remoteProjectFile.GetDiagnosticLogItemsAsync(cancellationToken); | ||
| if (diagnosticLogItems.Any()) | ||
| if (hasLoadErrors || diagnosticLogItems.Any()) | ||
| { | ||
| await LogDiagnosticsAsync(diagnosticLogItems); | ||
| } | ||
|
|
||
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.
this is still only available in .net10 right, which hasn't fully released? Should this still be a warning?
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.
Yes...actually, this is kinda annoying, because we probably still want to distinguish "SDK too old" cases, from "run-api is present, but its results were completely messed up". No need to report anything in the "SDK too old" case.
I will have to take a look at how to make that distinction.