Hi cademon bishop,
The error message “can't find a project to run” generally means dotnet watch is unable to locate the .csproj file for the project. We have verified everything on our end, and all appears to be in order. However, here are some additional steps you can try.
First, confirm you’re in the correct directory where the ContosoPizza.csproj file is located. This should be C:\Users######\mslearn-create-razor-pages-aspnet-core. If you're already in the correct directory and still seeing the error, you might try explicitly specifying the project file by running dotnet watch --project ContosoPizza.csproj. This tells dotnet watch exactly which project to monitor and run.
Please also ensure that the correct .NET SDK version is installed. Since this project uses .NET 7.0, you can check that version by running dotnet --list-sdks in the command prompt. If .NET 7.0 is missing, you’ll need to install it, or alternatively, you can adjust the project to target .NET 8.0 by updating the <TargetFramework> in the .csproj file from net7.0 to net8.0.
Finally, we have included a screenshot for reference:
Please feel free to contact us if you have any additional questions.
If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.