I have created a solution and a webapi project in it's own folder. I have then added the project to the solution.
I would like to be able to run dotnet run
without specifying the project by setting a default (Like i would in Visual Studio)
Is this possible or not yet doable with the CLI?
At the moment, this is not possible with dotnet run
.
dotnet run
does call msbuild targets to do a restore and build but queries the actually program and arguments to run from a new static evaluation, which means that even if you add custom build logic to a solution (=> the "project" being built), you don't have a chance to run custom msbuild logic to fetch these properties from other projects. (One could still hard-code relative paths to the built executable but this is very cumbersome and not very flexible)
This means the best way would be to create scipts (.bat, .sh) that call the right dotnet run -p my/project
command for you without requiring you to do much typing.