Add Aspire.Hosting.Dotnet integration package - #18442
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18442Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18442" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR introduces a new experimental Aspire.Hosting.Dotnet language-integration package, making C# a sibling of the existing Go/Python/JavaScript language packages. It relocates CSharpAppResource and the AddCSharpApp extension methods out of core Aspire.Hosting, rebases CSharpAppResource from ProjectResource onto ExecutableResource (launched as dotnet run --project|--file), and extracts a shared internal IProjectLaunchDefaultsResource interface so the project-defaults wiring (Kestrel endpoints, launch-profile environment, ASPNETCORE URLs) can be reused by both core ProjectResource and the relocated CSharpAppResource. This is described as the first part of the "Project V2" workstream, with debug and publish/compute parity explicitly deferred.
Changes:
- New
Aspire.Hosting.Dotnetpackage:CSharpAppResource(now anExecutableResource) andAddCSharpAppoverloads that build thedotnet runcommand line, validate the path/SDK version, and apply project defaults. - New internal
IProjectLaunchDefaultsResourceabstraction implemented explicitly by bothProjectResourceandCSharpAppResource;WithProjectDefaultsandLaunchProfileExtensionsgeneralized fromProjectResourceto the interface/IResource. - Blazor gateway and its tests migrated to
CSharpAppResource;CSharpApptests relocated to a newAspire.Hosting.Dotnet.Testsproject (no test coverage lost).
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.Hosting.Dotnet/CSharpAppHostingExtensions.cs |
New relocated AddCSharpApp + polyglot dispatcher; builds dotnet run args and validation. |
src/Aspire.Hosting.Dotnet/CSharpAppResource.cs |
Rebased resource on ExecutableResource; explicit IProjectLaunchDefaultsResource state impl. |
src/Aspire.Hosting/ApplicationModel/IProjectLaunchDefaultsResource.cs |
New internal abstraction shared by core and the new package. |
src/Aspire.Hosting/ApplicationModel/ProjectResource.cs |
Implements the new interface via private fields + explicit members. |
src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs |
WithProjectDefaults/helpers generalized to the interface; GetConfiguration uses .Single(). |
src/Shared/LaunchProfiles/LaunchProfileExtensions.cs |
Signatures widened ProjectResource → IResource (complete and consistent). |
src/Aspire.Hosting.Blazor/BlazorGatewayExtensions.cs |
Gateway return/param types changed to CSharpAppResource. |
src/Aspire.Hosting.Blazor/Aspire.Hosting.Blazor.csproj |
Adds Aspire.Hosting.Dotnet project reference. |
src/Aspire.Hosting.Dotnet/README.md |
New package README following language-integration conventions. |
tests/Aspire.Hosting.Dotnet.Tests/* |
New test project with relocated + new coverage (args, metadata, debugging, launch-profile, guards). |
tests/Aspire.Hosting.Tests/ProjectResourceTests.cs, ResourceCommandAnnotationTests.cs |
Remove CSharpApp tests (relocated) and unused suppression pragma. |
tests/Aspire.Hosting.Blazor.Tests/* |
Gateways switched to AddCSharpApp; add Aspire.Hosting.Dotnet reference + suppression. |
Aspire.slnx |
Registers the new source and test projects. |
docs/plans/project-v2-csharpprogram-watch.md |
Planning doc describing the staged workstream and intentional deferrals. |
This comment has been minimized.
This comment has been minimized.
Karol Zadora-Przylecki (karolz-ms)
left a comment
There was a problem hiding this comment.
Found 3 issues: 3 correctness/behavior regressions.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Probably not in scope for this PR, but would you expect the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: karolz-ms <15271049+karolz-ms@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Tests selector (audit mode)The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement. Runs the full test matrix + all jobs (ALL) — run-all fallback: '.markdownlintignore' is neither Layer-1-owned nor matched by a Layer 2 rule Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
I have done multiple rounds of AI code reviews and PR testing for this PR and believe all issues have been addressed. |
David Fowler (davidfowl)
left a comment
There was a problem hiding this comment.
We need a playground sample that uses this new resoruce type.
I will add the playground sample and new .NET Functions resource to the feature plan in my next PR. |
435f5d0
into
main
|
Documentation was required and all content was authored and committed to branch Triggered signals (6): Documentation authored (needs manual PR):
See the workflow run for details: https://github.com/microsoft/aspire/actions/runs/28605119390 |
Description
Adds
Aspire.Hosting.Dotnetlanguage integration package (making C# a sibling of Go/Python/Javascript). This is first part of "Project V2" workstream.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?