how can i solve Microsoft.MakeFile.targets(44, 5): [MSB3073]

My environment:

Visual Studio Community 2022 17.10.3
Unreal Engine 5.1.1/Unreal Engine 5.3.2
JetBrains Rider 2024.1.4 RD-241.18034.76
Using Visual Studio 2022 14.38.33139 toolchain

Error reported during compilation:

10>Microsoft.MakeFile.Targets(44,5): Error MSB3073 : The command “D:\UE_5.3\Engine\Build\BatchFiles\Build.bat NetworkTeachingEditor Win64 Development -Project="C:\Users\My\Documents\Unreal Projects\NetworkTeaching\NetworkTeaching.uproject" -WaitMutex -FromMsBuild” exited with code 6.

I deleted the following files/folders, then right-clicked the .uproject file and clicked Generate Visual Studio project files. After recompiling, there was no such error. This is useful to me.

.idea
.vs
Binaries
DerivedDataCache
Intermediate
Saved
.vsconfig
NetworkTeaching.sln