Ue5 Dedicated server build error.

I’m trying to create and build a dedicated server. When I build the target I get this error.

:\Program Files\Epic Games\UnrealEngine-5.0\Engine\Build\BatchFiles\Build.bat” game1 Development -WaitMutex -FromMsBuild” exited with code 6. Game1 C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets

Does anyone know what causes this?