dotnet / dotnet/sdk

[CLI] The default message is problematic when running web apps with Agent mode

Open
#52,286 4 comments 0 reactions 1 assignee Claimed by @baronfel View on GitHub
Area-WebSDK
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

Couldn't find a project to run. Ensure a project exists in <> or pass the path to the project using --project.

The LLM then does `dotnet run --project <>` which in the context of running a webapp is incorrect, since it uses the current folder as working directory, which means that the ContentRoot is not correct for the app and things like static files aren't found.

There are several options here:
* Change the message to suggest navigating to the directory and running from there.
* Remove the suggestion to use `--project`
* Qualify the suggestion to explicitly call out that for web apps you should navigate to the folder.
* There might be a way to force the app to use the correct working directory independent of where `dotnet run` is called from (something in launchSettings.json)?

@baronfel @danroth27 @DamianEdwards

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.