You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue describes the goals, key design decisions, and roadmap for version 2 of the Project resource. Project resource represents a C# program that is part of an Aspire application.
Loose coupling with application host (Project v2 as "ordinary" resource)
C# application host that uses Project v2 resources does not have a reference to C# service project(s) (unlike Project v1). There is no special code generation.
C# projects are added to the model using relative paths just like Aspire application services implemented in other languages.
Programmatic build configuration
Build configuration and launch/debug options can be controlled from Aspire model.
Build configuration in Aspire model can also be applied to deployment.
Integrations can override build configuration defaults
Application host code can override build configuration defaults
Improved watch experience (via new aspire-watch)
Rebuild and re-start occurs reliably for service code changes and for shared library changes.
Watch server is started/stopped automatically as hidden, system resource.
Partial runs (ability to run a subset of services)
Launch groups specify resources to include.
Aspire app model computes transitive closure of resources to run. Resources outside of the closure are not part of the run.
Resources within closure are built efficiently and correctly (e.g. via temporary SLNX files).
After application starts, developers can on-demand start additional resources (ones that are not part of the initial, partial run).
Persistent execution
Running projects can survive application host shutdown and can be re-used for subsequent application runs.
Requires new "persistent Executables" feature from DCP.
Container-based execution
Project v2 resources can optionally be launched as containers instead of running as ordinary OS processes.
Scope might be limited to projects that use SDK-based container image build.
Debugging
Starting Projects v2 under debugger works ("F5" from IDE), including debugging startup code.
Attaching to running service works.
"Run under debugger" + watch might be impossible initially; attach should work).
Model events and callbacks review
Part of the Project v2 work should include review and re-design (as necessary) of related model events and callback contracts. For various execution scenarios we should be clear about:
What events are MUST be raised vs what events MAY be raised
Any ordering and concurrency guarantees (event X will be raised before Y; event X handlers must complete before event Y is raised etc.)
Any cardinality guarantees (how many times an event may be raised)
The same applies for callbacks (e.g. environment variable- and invocation parameter callbacks).
Illustrative issue: environment variable callback may need to be invoked to compute transitive closure of resources for partial run, even if the associated resource is NOT part of the run.
Orthogonal capabilities
To the largest extent possible, the design should allow for free combination of capabilities listed above. For example, it should be possible to have a partial run with some projects using persistent execution, all in watch mode.
Top-tier frameworks work (no take-back)
The current implementation of C#-based service resource in Aspire includes support for top-tier frameworks such as Azure Functions and Blazor. The new Project V2 resource should preserve this support. When Project V2 GAs, developers should be able to migrate to Project V2 resource type without losing any major capabilities that exist today.
Project V2 resources can be published
Publishing should work largely unchanged when application host code switches from existing ProjectResource to Project V2 resource.
I'd love it if the ProjectV2 resource could discriminate based on annotations, rather than base classes. That would better allow substitution (e.g. I want a custom resource to be container / dotnet tool based based when I publish it as a nuget package, but a project when working with the source solution. As well as allowing me to strongly type my resources.
At least from DCP / Aspire Hosting perspective. If you want to have the default implementation be a concrete type so you can cleanly target extension methods, that's totally fine.
Project v2 resources can optionally be launched as containers instead of running as ordinary OS processes.
Do we need this?
I do find myself conflicted. I've found that a lot of people ask for this, to make their dev environment more production like, but assume that it is zero compromise. But there are compromises.
Complexity - involving the container runtime adds more complexity, with more opportunities for things to go wrong
Time costs - building the container add extra time
Hopefully the aspire integration can hide a lot of the complexity, but even if hiding it, the complexity will still be ther eunder the hood. And complexity == opportunity for things to go wrong.
So yes it's a useful capability, but I do always want to ask people whether they're sure, as often the answer is they don't need it.
But there are cases where it's absolutely necessary - particularly if you're interoping with native code, running that code in the container base image you'll deploy to production with is beneficial (and in some cases required if the library doesn't' support your host OS), so it is a useful capability to have.
Will persistent project v2 also encompass generic executables. Thinking about this for WithTerminal(...).
Project v2 is about C# programs, so technically no because terminal support is really independent from the implementation language of the program. That said, it is absolutely a requirement that Project v2 plays well with whatever we decide to support for all executables including terminal integration. How this is actually expressed in Aspire (runtime) code is an open question.
Alex nailed the business case for running-as-container.
From the roadmap perspective I do not think it is part of MVP (minimum viable product), but I do think Project v2 should be designed in a way that adding container execution should be relatievely easy (on top of MVP).
Alex nailed the business case for running-as-container.
From the roadmap perspective I do not think it is part of MVP (minimum viable product), but I do think Project v2 should be designed in a way that adding container execution should be relatively easy (on top of MVP).
Pedantically, running a project as a container is fairly straight forward (especially if annotation based 😉).
Create a sub resource to `dotnet publish /t:Container
Make the project .WaitFor() the resource in 1.
Add ContainerImageAnnotation and stop DCP from running the project as an executable
I have some hacks that can do that with project V1. (Because stopping DCP is type based for executables, not annotation)
But when people say "Run as a Container", I find they usually mean "Debug the project as a container", which is where things get trickier.
Partial runs (ability to running subset of services)
Sorry for the ignorance, why is that feature wrapped up in this epic? How does it relate?
Mainly because we need to improve how C# projects are built in order to do partial runs efficiently and correctly, so there's impact on design and implementation. That said, partial runs are about all sorts of resources, not just C# programs, so good question.
MVP for 13.6 release has been completed. Moving out of 13.6 milestone to track future work as described in the Goals and Design Principles (#16386 (comment))
Activity
karolz-ms commentedon Apr 22, 2026
Goals and Design Principles
Loose coupling with application host (
Projectv2 as "ordinary" resource)C# application host that uses
Projectv2 resources does not have a reference to C# service project(s) (unlikeProjectv1). There is no special code generation.C# projects are added to the model using relative paths just like Aspire application services implemented in other languages.
Programmatic build configuration
Build configuration and launch/debug options can be controlled from Aspire model.
Build configuration in Aspire model can also be applied to deployment.
Integrations can override build configuration defaults
Application host code can override build configuration defaults
Improved watch experience (via new aspire-watch)
Rebuild and re-start occurs reliably for service code changes and for shared library changes.
Watch server is started/stopped automatically as hidden, system resource.
Partial runs (ability to run a subset of services)
Launch groups specify resources to include.
Aspire app model computes transitive closure of resources to run. Resources outside of the closure are not part of the run.
Resources within closure are built efficiently and correctly (e.g. via temporary SLNX files).
After application starts, developers can on-demand start additional resources (ones that are not part of the initial, partial run).
Persistent execution
Running projects can survive application host shutdown and can be re-used for subsequent application runs.
Requires new "persistent Executables" feature from DCP.
Container-based execution
Project v2 resources can optionally be launched as containers instead of running as ordinary OS processes.
Debugging
Starting Projects v2 under debugger works ("F5" from IDE), including debugging startup code.
Attaching to running service works.
"Run under debugger" + watch might be impossible initially; attach should work).
Model events and callbacks review
Part of the Project v2 work should include review and re-design (as necessary) of related model events and callback contracts. For various execution scenarios we should be clear about:
The same applies for callbacks (e.g. environment variable- and invocation parameter callbacks).
Orthogonal capabilities
To the largest extent possible, the design should allow for free combination of capabilities listed above. For example, it should be possible to have a partial run with some projects using persistent execution, all in watch mode.
Top-tier frameworks work (no take-back)
The current implementation of C#-based service resource in Aspire includes support for top-tier frameworks such as Azure Functions and Blazor. The new Project V2 resource should preserve this support. When Project V2 GAs, developers should be able to migrate to Project V2 resource type without losing any major capabilities that exist today.
Project V2 resources can be published
Publishing should work largely unchanged when application host code switches from existing ProjectResource to Project V2 resource.
karolz-ms commentedon Apr 22, 2026
Proposal: improved watch as initial vertical slice
Scope:
Tracking issue: #15710
mitchdenny commentedon Apr 22, 2026
Will persistent project v2 also encompass generic executables. Thinking about this for
WithTerminal(...).eerhardt commentedon Apr 22, 2026
Do we need this?
afscrome commentedon Apr 23, 2026
I'd love it if the ProjectV2 resource could discriminate based on annotations, rather than base classes. That would better allow substitution (e.g. I want a custom resource to be container / dotnet tool based based when I publish it as a nuget package, but a project when working with the source solution. As well as allowing me to strongly type my resources.
At least from DCP / Aspire Hosting perspective. If you want to have the default implementation be a concrete type so you can cleanly target extension methods, that's totally fine.
I do find myself conflicted. I've found that a lot of people ask for this, to make their dev environment more production like, but assume that it is zero compromise. But there are compromises.
Hopefully the aspire integration can hide a lot of the complexity, but even if hiding it, the complexity will still be ther eunder the hood. And complexity == opportunity for things to go wrong.
So yes it's a useful capability, but I do always want to ask people whether they're sure, as often the answer is they don't need it.
But there are cases where it's absolutely necessary - particularly if you're interoping with native code, running that code in the container base image you'll deploy to production with is beneficial (and in some cases required if the library doesn't' support your host OS), so it is a useful capability to have.
karolz-ms commentedon Apr 23, 2026
Project v2 is about C# programs, so technically no because terminal support is really independent from the implementation language of the program. That said, it is absolutely a requirement that Project v2 plays well with whatever we decide to support for all executables including terminal integration. How this is actually expressed in Aspire (runtime) code is an open question.
karolz-ms commentedon Apr 23, 2026
Alex nailed the business case for running-as-container.
From the roadmap perspective I do not think it is part of MVP (minimum viable product), but I do think Project v2 should be designed in a way that adding container execution should be relatievely easy (on top of MVP).
adamint commentedon Apr 23, 2026
Sorry for the ignorance, why is that feature wrapped up in this epic? How does it relate?
afscrome commentedon Apr 23, 2026
Pedantically, running a project as a container is fairly straight forward (especially if annotation based 😉).
.WaitFor()the resource in 1.ContainerImageAnnotationand stop DCP from running the project as an executableI have some hacks that can do that with project V1. (Because stopping DCP is type based for executables, not annotation)
But when people say "Run as a Container", I find they usually mean "Debug the project as a container", which is where things get trickier.
karolz-ms commentedon Apr 23, 2026
Mainly because we need to improve how C# projects are built in order to do partial runs efficiently and correctly, so there's impact on design and implementation. That said, partial runs are about all sorts of resources, not just C# programs, so good question.
davidfowl commentedon Apr 23, 2026
Not required for an MVP no Eric Erhardt (@eerhardt)
joperezr commentedon Sep 14, 2026
For 13.6, the remaining work here is to finish up the skill for migration, and check what the VS experience looks like with the new flow.
Stay on NuGet for DCP and the dashboard; suppress ASPIRE010
karolz-ms commentedon Sep 25, 2026
MVP for 13.6 release has been completed. Moving out of 13.6 milestone to track future work as described in the Goals and Design Principles (#16386 (comment))