Launching Unreal Editor from VS2022 fails. "UnrealBuildTool.exe (process 1412) exited with code 1 (0x1)"

I fixed the issue. I followed this and did Set Startup Project on my project in Solution Explorer and now I’m able to start unreal editor from VS.