microsoft / microsoft/aspire

[Aspire 10] - Obsolete AddProject<>, replace with AddDotnetApp

Open
#10,638 9 comments 2 reactions 0 assignees View on GitHub
area-app-model
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

## Background and Motivation

We should consider aligning the APIs for dotnet with JS/Python - and removing the need for project references. We would have to handle any code gen or build ordering that dotnet itself handles via the projectrefs now.

It would be great to have dotnet line up w the other langs -- we can still enable the powerful dotnet experience we have today but with a unified API. This also solves one of my personal gripes of having to mess around with project references by hand in vs code lol.

Additionally, this would work with single file apps!!!! YAY

## Proposed API

Please provide the specific public API signature diff that you are proposing. For example:
```diff
namespace Aspire.Hosting;

- public static ApplicationModel.IResourceBuilder AddProject(
- this IDistributedApplicationBuilder builder
- string name
- string projectPath);
+ public static ApplicationModel.IResourceBuilder AddDotnetApp(
+ this IDistributedApplicationBuilder builder,
+ string name,
+ string projectFilePath); (could overload for string csharpFilePath or something)

```

## Risks

Definitely gonna require work across the stack. Obsoleting an API that _everyone_ uses is pretty messy, too, but we should do this before it's too late lol

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing AddProject API and the proposed AddDotnetApp signature on IDistributedApplicationBuilder. Then trace how ProjectResource and the proposed DotnetAppResource participate in project references, code generation, and build ordering. Done requires an agreed API and migration approach that addresses the cross-stack and obsoletion risks.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend-api-design, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.