Skip to content
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

Support dotnet {publish,build,restore} --project #39793

Open
Smaug123 opened this issue Mar 27, 2024 · 2 comments
Open

Support dotnet {publish,build,restore} --project #39793

Smaug123 opened this issue Mar 27, 2024 · 2 comments
Assignees
Labels

Comments

@Smaug123
Copy link

Is your feature request related to a problem? Please describe.

One of the most prominent inconsistencies in the dotnet CLI is that dotnet run requires you to supply --project, whereas all the other commands (publish, build, restore at least) require you not to supply it. I hit this at least once a week and it's annoying every time.

Describe the solution you'd like

Surely these invocations could all accept both --project foo and the current positional foo interchangeably? And throw if there's a spare positional argument when --project was supplied, so you can't try and supply both.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-CLI untriaged Request triage from a team member labels Mar 27, 2024
@nagilson nagilson added needs team triage Requires a full team discussion and removed untriaged Request triage from a team member labels Apr 9, 2024
@nagilson
Copy link
Member

nagilson commented Apr 9, 2024

I see where you are coming from, yet: dotnet run without --project would have very high ambiguity: the parameter could be an argument to dotnet run, aka which project to run, OR it could be an arg for the program you are running. We could try to change the semantics to match build and publish by providing other ways in the command to reduce the ambiguity with a newer approach like this, but that is highly likely to break a lot of existing scripts and CI/CD, we'd need to consider this for Preview 1 of .NET 10 if we decide to do this.

Perhaps we should document this with some specific examples.

@nagilson nagilson removed the needs team triage Requires a full team discussion label Apr 9, 2024
@Smaug123
Copy link
Author

Smaug123 commented Apr 12, 2024

Certainly having dotnet run require --project seems good to me, for the reason you state. I'd be quite happy to resolve the inconsistency in the other direction: have the dotnet foo commands accept --project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants