When I run dotnet watch publish it appears to be ignoring the publish command and trying to do run instead.
This is the error:
PS D:\Development\ProjectOne> dotnet watch publish --project Client/ --configuration Release
dotnet watch Started
Unable to run your project.
Ensure you have a runnable project type and ensure 'dotnet run' supports this project.
A runnable project should target a runnable TFM (for instance, net5.0) and have OutputType 'Exe'.
The current OutputType is 'Library'.
dotnet watch ❌ Exited with error code 1
dotnet watch ⏳ Waiting for a file to change before restarting dotnet...
I tried running with and without the publish command and same result also tried with different configurations but no dice.
Add a global.json file to the directory where commands are being executed, specifying the desired .NET SDK version.
references: dotnet watch, dotnet publish, dotnet run, Select the .NET version to use, global.json overview
I ran this command with the verbose option.
dotnet watch --verbose --project test_project.csproj publish --configuration ReleaseA known issue where dotnet watch prefixes the input command with run.
Found several reports of this issue on Github: dotnet watch broken in 8.0.100, dotnet-watch support for publish subprocess