Fix arg annotations when running in IDE mode#7711
Conversation
There was a problem hiding this comment.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
tests/Aspire.Hosting.Tests/Dcp/DcpExecutorTests.cs:158
- Slicing exe.Spec.Args without verifying its initialization can lead to a null reference exception when executionType is not IDE. Please ensure that exe.Spec.Args is non-null before attempting to slice it.
var callArgs = executionType == ExecutionType.IDE ? exe.Spec.Args : exe.Spec.Args![^(expectedArgs?.Length ?? 0)..];
tests/Aspire.Hosting.Tests/Dcp/DcpExecutorTests.cs:121
- [nitpick] The parameter 'executionType' is being compared to ExecutionType.IDE, which may be of a different type than string. Consider aligning the types (for example, by using an enum consistently) to improve clarity and avoid potential type conversion issues.
if (executionType == ExecutionType.IDE)
|
@captainsafia I think this change removes the need for #7683. Can probably revert it after merge. |
captainsafia
left a comment
There was a problem hiding this comment.
Not an expert but LGTM overall -- it does appear that the double --port fix can be reverted with this change set.
|
/backport to release/9.1 |
|
Started backporting to release/9.1: https://github.com/dotnet/aspire/actions/runs/13444068467 |
|
/backport to release/9.1 |
|
Started backporting to release/9.1: https://github.com/dotnet/aspire/actions/runs/13446883474 |
Description
Apply behavior from https://github.com/dotnet/aspire/blob/main/docs/specs/IDE-execution.md#launch-profile-processing-project-launch-configuration when displaying args in the dashboard.
Two changes:
project.Spec.Argsis left as null. That wasn't happening but appears to have special behavior according to the IDE execution spec. Maybe something along the toolchain automatically converts an empty array to null?Checklist
<remarks />and<code />elements on your triple slash comments?breaking-changetemplate):doc-ideatemplate):