microsoft / microsoft/aspire

Running a .NET project using `AddProject` with the csproj path fails if the project has not been previously built

Open
#2,154 16 comments 5 reactions 0 assignees View on GitHub
area-tooling needs-design
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

I'm really glad that Preview 2 of Aspire added the `AddProject` overload so we can reference a .NET project by providing an arbitrary project path. However, I feel like Aspire currently assumes that this project is part of (and referenced by) the app host solution, which would result in the project being built before being orchestrated by Aspire. If my project is not part of the app host solution and it has not been compiled yet, Aspire will fail to run it as it uses `--no-build` when preparing the projects.

In my opinion, this process somewhat defeats the purpose of using `AddProject` with a custom path because if my project is already part of my solution, I would simply use `AddProject<>` with the generated service metadata.

Is there any plan to consider building the .NET project prior to running it when using `AddProject` with a custom path? I believe this overload would be beneficial for scenarios where developers deal with multiple solutions in a monorepo (or even multiple repos).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.