Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Apr 10, 2024

Backport of #3545 to release/8.0

/cc @eerhardt

Customer Impact

This is fixing 2 issues that impact customers:

  1. Allows developers to call .WithArgs on a Project. The args get passed to the app at runtime and written to the manifest. (Note that azd doesn't handle this correctly yet - tracking with [Issue] azd doesn't support args with Aspire on project.v0 resource Azure/azure-dev#3678)
  2. When we parse the launchSettings command line args string into a collection, we are not parsing double quotes correctly. This fixes the parsing to be consistent with VS's command line args parsing.

Testing

Manually tested that the .WithArgs args compose with the launchSettings.json command line args correctly in both VS and dotnet run.
Added new automated tests for parsing.

Risk

Low to Medium-Low. It shouldn't affect any existing scenario, and fixes command line args parsing. The new scenario of specifying args to a Project may uncover more bugs than just the azd bug.

Regression?

No

Microsoft Reviewers: Open in CodeFlow

Also fix the command line arg parsing to be the same as .NET Process's:
* double quotes around single arguments
* consecutive double quotes inside a quoted argument means one double quote

Fix #3306
@ghost ghost added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Apr 10, 2024
@dotnet-policy-service dotnet-policy-service bot added the Servicing-consider Issue for next servicing release review label Apr 10, 2024
@danmoseley danmoseley added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Apr 10, 2024
@davidfowl davidfowl merged commit f1b9c55 into release/8.0 Apr 10, 2024
@davidfowl davidfowl deleted the backport/pr-3545-to-release/8.0 branch April 10, 2024 19:15
@danmoseley danmoseley mentioned this pull request Apr 12, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants