How to force UE5.3 to use VS2022

Hi, I have a problem packaging my game with UE5.3. I have visual studio 2019 and 2022 installed and up to date. But it seems that Unreal refuses to use the vs2022 version. Here is the end of the log:

Microsoft platform targets must be compiled with Visual Studio 2022 17.4 (MSVC 14.34.x) or later for the installed engine. Please update Visual Studio 2022 and ensure no configuration is forcing WindowsTargetRules.Compiler to VisualStudio2019. The current compiler version was detected as: 14.29.30153
UATHelper: Packaging (Windows): Took 0,91s to run dotnet.exe, ExitCode=6
UATHelper: Packaging (Windows): UnrealBuildTool failed. See log for more details. (C:\Users\seble\AppData\Roaming\Unreal Engine\AutomationTool\Logs\F+UNREAL+ENGINE+UE_5.3\UBT-MyProjectTEST-Win64-Shipping.txt)
UATHelper: Packaging (Windows): AutomationTool executed for 0h 0m 3s
UATHelper: Packaging (Windows): AutomationTool exiting with ExitCode=6 (6)
UATHelper: Packaging (Windows): BUILD FAILED
PackagingResults: Error: Unknown Error

If you need more information, I am at your disposal.

A blank project, package without any problems. And is playable. But as soon as I add a plugin or just add a metahuman, I always get this error message.

Please I really need help

Open Visual Studio Installer > Modify > Individual Components > Search for MSVC > Check MSVC ( Most Recent )
You can uncheck other MSVC versions.

Thanks but that’s already the case. The checked version is MSVC v143 - VS 2022 C++ x64/x86 Build tools (last version)

In my case I uninstalled VS 2019, but did you try change in Unreal Editor > Edit > Editor Preferences > Source Code Editor to VS 2022 and Tools > Refresh Project?

Thank you very much, it works now. It was the option in Editor Preferences that worked. I had already tried to uninstall VS2019. But then the error message told me to install VS2019.

Thank you so much

1 Like

If it was

UE5 Visual Studio 2019 x64 must be installed in order to build this target.

then this solves this problem

upd: this modification should be removed when you decide to upgrade to 5.4. It didn’t help me to remove the added lines, but removing the file at all did help

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.