要使用指定的绝对路径运行dotnet core应用程序,我们需要运行以下命令:
dotnet run -p C:\foo\bar\Project\Project.csproj
但似乎使用 dotnet watch run
没有相同的效果:
watch : Could not find a MSBuild project file in 'C:\directory\where\we\execute\command'. Specify which project to use with the --project option.
使用-project
代替-p
运行相同的命令并不能帮助解决问题,但是Dotnet watch帮助文档中确实指定了-p
或-project
参数。因此,为什么在使用dotnet watch run
时使用项目的绝对路径不起作用,而在使用dotnet run
时却可以呢?