Generate cpp project Couldn't find UnrealBuildTool

Another possibility: if you have this environment variable set on windows ( MSBuildSDKsPath
C:\Program Files\dotnet\sdk\3.1.201\Sdks ) , remove it, reboot.

I found my clean.bat mentioned by xi57 already correct, but running it… I got errors like mentioned here: MSB4018: The "GenerateDepsFile" task failed unexpectedly. · Issue #3376 · dotnet/sdk · GitHub
took the key out of the environment variables table and everything worked.