Should AddCsharpApp with defaultWatchEnabled require a project reference or not?
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
According to the documentation:
> Unlike [AddProject](https://learn.microsoft.com/en-us/dotnet/api/aspire.hosting.projectresourcebuilderextensions.addproject), which requires a project reference, the AddCSharpApp method can add C# projects or file-based apps using a path to a *.cs file, *.csproj file, or project directory. This is useful for adding file-based apps introduced in .NET 10 or for including projects without adding a project reference to the AppHost.
However, when I try to combine this (not having a project reference) with the setting `feature.defaultWatchEnabled=true`, I'm not sure that is true.
In that case, I end up [here](https://github.com/dotnet/sdk/blob/f578225fe1fdd93db9efac273562b3709db9e8e9/src/BuiltInTools/Watch/Build/ProjectNodeMap.cs#L27): `Project '{ProjectPath}' not found in the project graph.`
Is this a bug, or a by-design limitation?
Contributor guide
Assessment
This issue has not been assessed yet.