Visual Studio 2022 builds and runs UE5.0

HI @maimonides11,
I am currently using the UE5 Release_test version and that seems very stable as well. To cut the long story short VS2022 is still undergoing updates on the new minor version. Officially :rofl::rofl:UE does not support this for production, but UE5 is experimental. IMHO by the time, it gets released in 2022 UE5 will be able to use VS2022 just like the transition from VS2017 to VS2019

I’ve had no issues with using 2022 with the 5.0 branch without engine modifications.

1 Like

I literally can’t get it to work with any 5.0 branch. I get to the build within the ue5.sln but it just succeeds 3 but fails 1 with an error MSB3073 - I have no idea what’s going on :frowning:

Getting error MSB3073 (microsoft.com)

There are two problems the path length of your local repository is too long
mine was originally c:\user\owner\source\repos\ue50-release-test-local.
this means that when the batch builder tries to make the file it becomes
c:\user\owner\source\repos\ue50-release-test-local\Engine\Binaries\msbdatetime2022.bat.
That now hits an old limit set by windows.
I am now using c:\user\owner\ue50 and this seem to work

Second, if your Appdata directory is hidden this will fail as it needs to create
Appdata\UnrealEngine directory and there will be a domain protection error in Windows Professional

There appears to be a problem building UE5 source with the latest version of Visual Studio 2022 and that has a much simpler fix in the GitHub article
Quoted here for ease

Hi! I was able to reproduce this issue and managed to fix it. UE5 uses /sourceDependencies compiler option that produces these .cpp.json files.
The problem is in the latest MSVC compiler (14.32.31326: MSVC v143 - VS 2022 C++ v14.32-17.2). Starting from this version, the “Version” field in the files produced is equal to 1.2.
As a temporary solution, I suggest downgrading the compiler to any lesser version. I have validated the following versions and confirm they are fine to use.
14.29.30133: MSVC v142 - VS 2019 C++ v14.29-16.11
14.30.30705: MSVC v143 - VS 2022 C++ v14.30-17.0
14.31.31103: MSVC v143 - VS 2022 C++ v14.31-17.1

You can set the compiler version via BuildConfiguration.xml in a way like

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<WindowsPlatform>
    <Compiler>VisualStudio2022</Compiler>
    <CompilerVersion>14.31.31103</CompilerVersion>
</WindowsPlatform>
</Configuration>

From the above the line
CompilerVersion 14.31.31103 has been selected this is an older version of the compiler and is a much quicker fix than changing the source code which is a good fix, just more complicated as you need to know and use extra Git Bash commands.

Note: You would need to Clean and Rebuild your project via IDE

the link to this article is at
https://github.com/EpicGames/UnrealEngine/pull/9067#issuecomment-1102164891

Using the Patch described in the Github Pull Request 9067

$ git remote -v
origin https://github.com/EpicGames/UnrealEngine (fetch)
origin https://github.com/EpicGames/UnrealEngine (push)

This command will install the VS2022 patch to your repository source code

$ git pull origin pull/9067/head:ue5v22

You will now need to Clean and build UE5 again via Right Click on project

1 Like

i am using lastest VS2022 version to build the UE5.0.1 codebase. and it cannot launch the EpicGame launcher. it stopped running in 75% and quit. Error prompt: failed to load plugin “VisualStudioCodeSourceCodeAccess”, VisualStudioCodeSourceCodeAccess can not be opened. and i have modified the toolchain and tried again, the same error.
some other solutions i have already tried, still not working out.

any suggestion to fix this? i have been working on this for weeks. thanks for reply…

Hi @benjaminbbq,
To find if you have this plugin you need to look in

C:\Program Files\Epic Games\UE_5.0\Engine\Plugins\Developer\VisualStudioCodeSourceCodeAccess\Intermediate\Build\Win64\UnrealEditor\Development\VisualStudioCodeSourceCodeAccess

For “UnrealEditor-VisualStudioCodeSourceCodeAccess.lib”

You can disable the use of the plugin as below

Check that your installation is good and all plugins loaded

@Jimbohalo10 thanks for share the solution. i have checked the setting as your suggestion above. that is for the epic game launcher is already opened. my issue is that building from the ue5 source code and the ue5 engine[epic game launcher] can’t start(open) after the vs2022 builded. :joy:
anyway, thanks for the suggestion. it may help in another way.

Hi @benjaminbbq,

Epic Launcher does not, currently support VS2022, only VS2019. The BINARY is built in VS2019. That is why the VS2022 source created is quicker.

The UE Editor can be launched by creating a desktop shortcut as below

You can also launch directly into your project by

You can send the “MyProj.uproject” to the desktop to launch the project in the Editor. It’s in a Blue shortcut

This is something due to appear in Epic Launcher later
much later for version 5.X.y, but is supported in 4. * :rofl:

Hi All,
While trying to build UE5-main, today 16th May 2022.
I have encountered an error based on VS2022
This was a link error

Error LNK1181 cannot open input file ’ ROOT:\ue5main\Engine\Source\ThirdParty\etc2comp\lib\Win64\Release\EtcLib.lib ’

In the source, there is a file at
ROOT:\ue5-main\Engine\Source\ThirdParty\etc2comp\BuildForUE
BuildForWindows.bat which needs to be run in the
If you don’t have VS2019 installed change the line

“%_vsinstall%\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe” -G “Visual Studio 16 2019” -A x64 “%PATH_TO_CMAKE_FILE%”

to

“%_vsinstall%\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe” -G “Visual Studio 17 2022” -A x64 “%PATH_TO_CMAKE_FILE%”

Open the Start Menu\Programs\Visual Studio 2022\Visual Studio Tools\VC
x64 Native Tools Command Prompt for VS 2022

cd ROOT:\ue5-main\Engine\Source\ThirdParty\etc2comp\BuildForUE
BuildForWindows.bat

for some unknown reason even with 2019 installed this will not be built automatically so you must restart the UE5 2022 build again

There may be other ThirdParty libraries that need fixing using the same method above and these can be found using “Find Files” and the search parameter “Visual Studio 16 2019”

see, thanks for all your guidelines very mush. i am using the editor installed instead of lastest sourcecode as you said above. now it work for temporary. thanks for your reply

Hi All,
There is a problem with the new version 17.6 preview 2 wiith UE5.1 onward. It simply wont build without vs2019.
the Generateprojects.bat -2022 will not complete

I have made a patch listed in the posted in the thread below

Toolchain 14.32.31326 which comes as the default of VS2022 v17.2 onward cannot compile UE5 - Programming & Scripting