Skip to content

dotnet run should have a better warning when a user passes in a loose file and we're operating in project-mode #48529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
baronfel opened this issue Apr 16, 2025 · 1 comment
Labels
Area-Run Issues relating to `dotnet run` cli-ux Issues and PRs that deal with the UX of the CLI (exit codes, log output, verbs/options, and so on) untriaged Request triage from a team member

Comments

@baronfel
Copy link
Member

baronfel commented Apr 16, 2025

Describe the bug

dotnet/website-feedback#395

When a user passes in a file as the 'project' to build and this isn't a single-file-runnable file, we operate in 'project' mode. In that mode we try searching for a project in the directory specified by ./Program.cs in this linked issue. We should have a more clear error here: if a user passes in something file-like and there's a) a matching file in CWD and b) we're in 'project' mode, we should tell them to not specify the project (or better yet, just run the project!).

To Reproduce

See linked issue.

Exceptions (if any)

Further technical details

  • Include the output of dotnet --info
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Apr 16, 2025
@baronfel baronfel added cli-ux Issues and PRs that deal with the UX of the CLI (exit codes, log output, verbs/options, and so on) untriaged Request triage from a team member Area-Run Issues relating to `dotnet run` and removed untriaged Request triage from a team member Area-NetSDK labels Apr 16, 2025
@claudiaregio
Copy link

Thanks @baronfel :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Run Issues relating to `dotnet run` cli-ux Issues and PRs that deal with the UX of the CLI (exit codes, log output, verbs/options, and so on) untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants