Table of contents
foreword
Open unity today, when running the script, vs2019 prompts "This Unity project was not generated for Visual Studio Tools for Unity", and the unity project cannot be debugged. The project was fine yesterday, but this problem occurred overnight. I found that when I shut down yesterday, it should have been shut down directly, and it was not caused by closing the unity process and VS first. Here you need to regenerate the unity script project
Here is a record of the solution to the problem, so that you can refer to it when there is a problem later
Solution
Select Edit->Preferences in the unity dismantling column to regenerate the vs project
You can debug after re-opening unity and vs after generating.
My unity version is 2020.1.0f1.