Can't build UE5.sln using msbuild with VS 2022 Community Edition

I am trying to build UE5 using msbuild from Visual Studio 2022 Community Edition. In the x64 Native Build Tools Command Prompt for VS 2022. I have run the following commands:

Y:\UnrealEngine> Setup.bat
Y:\UnrealEngine> GenerateProjectsFiles.bat -2022

When I try to build using:

msbuild UE5.sln /t:rebuild /p:"Configuration=Development Editor" /p:Platform=Win64

I get a significant number of errors of the following form:

"Y:\UnrealEngine\UE5.sln" (rebuild target) (1) ->
"Y:\UnrealEngine\Engine\Intermediate\ProjectFiles\UE5.vcxproj.metaproj" (Rebuild target) (33) ->
"Y:\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj" (Rebuild target) (3:31) ->
  Y:\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

I followed the instructions in the “Windows” section of the README.md as to what to install within Visual Studio. How do I tell msbuild where the SDK is?

-Andy.

2 Likes

what msbuild.exe did you use?

I only had success with the executable from the VS2022 install directory.

That’s this path on my PC:
C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe

could you please tell me if you could compile successfully?

I couldn’t compile the engine from command line successfully, unfortunately.