I'm trying to upgrade a project from UE5.0 to 5.1

As the title says, I need to upgrade an UE5.0 project to UE5.1 (UE5.2 would be better, but not required). The problem consists that this project is quite big. It has more than two years of development and I’m not the only one working, we are a team of 4+ working on this project using Perforce. I’d rather stay in UE5.0 than move on to UE5.1 but the thing is that I need to use a specific plugin that only has support on 5.1 onwards. We always considered not updating our project for the amount of plugins related to level design we have implemented but this last plugin we aquired is a MUST. I hope you understand now that the option to stay on UE5.0 is no longer acceptable.

— Things to mention —

This project we’re working was created as a c++ project in UE4.27. The project has only one C++ class which is used only as the parent of the main player character. The class doesn’t contain anything. It’s just an empty class. All the code is in a blueprint created based of the c++ class. It was your typical junior error (hello, I’m the junior!). Because of reasons, we had to update the project to UE5.0 but everything worked well at the end. I’m planning to create the player character from scratch, so if I had to delete the c++ class, I wouldn’t have a problem doing that. If I could avoid that, it’d be better of course, but I can live without it.

For more readability in this post, I would refer to the act of deleting the .vs, .vscode, binaries, intermediate and saved folders as Folder Reset. If there’s a better term for this, please let me now. Also, I’ve been working with backups so I’m not worry about losing / corrupting any files. Now, on to the solutions I tried:

— Things I already tried but didn’t work: —

I proceed with a Folder Reset, Right-Click on the .uproject and select [Switch Unreal Engine Version…] option to switch from UE5.0 to UE5.1. After that it will generate project files but it won’t create a solution (.sln). Just in case, I tried opening the uproject but as expected a popup with the “MyCustomProject could not be compiled. Try rebuilding from source manually.” appeared. Tried doing a Folder Reset and Right-Click on the .uproject to [Generate Visual Studio project files] but again, the solution wasn’t created.

I did another Folder Reset, [Switch Unreal Engine Version] back to 5.0 and just to be sure, I did another Folder Reset, [Generate Visual Studio project files] and opened the solution with Visual Studio 2019. Pressed “Build” on the game so I can start from 0 again.

This time, without doing a Folder Reset, I launch UE5.1 and tried opening the project. A Warning shows up about converting the project. I select the Convert in-place because I already have a backup. It asked me to remove pretty much all plugins in order to proceed, so I did that, and this is the error that pops up.

Project files could not be generated. Log output:

Running D:/Editors/UE_5.1/Engine/Build/BatchFiles/Build.bat  -projectfiles -project="D:/MyCustomProject/depot/NameOfProject.uproject" -game -rocket -progress
Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" -projectfiles -project="D:/MyCustomProject/depot/NameOfProject.uproject" -game -rocket -progress
Log file: C:\Users\Myname\AppData\Local\UnrealBuildTool\Log_GPF.txt

Some Platforms were skipped due to invalid SDK setup: IOS, Android, Linux, LinuxArm64.
See the log file for detailed information

Discovering modules, targets and source code for project...
DEPRECATION: 'IniKeyBlacklist', which is a config key in section [/Script/UnrealEd.ProjectPackagingSettings], in 'D:\MyCustomProject\depot\Config\DefaultGame.ini', has been deprecated. Using 'IniKeyDenylist' instead. It is recommended you update your .ini files as soon as possible, and replace IniKeyBlacklist with IniKeyDenylist
DEPRECATION: 'IniSectionBlacklist', which is a config key in section [/Script/UnrealEd.ProjectPackagingSettings], in 'D:\MyCustomProject\depot\Config\DefaultGame.ini', has been deprecated. Using 'IniSectionDenylist' instead. It is recommended you update your .ini files as soon as possible, and replace IniSectionBlacklist with IniSectionDenylist
Binding IntelliSense data...
Exception while generating include data for NameOfProjectEditor: Unable to find plugin 'TargetSystem' (referenced via NameOfProject.uproject). Install it and try again, or remove it from the required plugin list.
Binding IntelliSense data... 100%
Writing project files...
Writing project files... 67%
Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at UnrealBuildTool.VSCodeProjectFileGenerator.WriteConfiguration(String Name, String ProjectName, IEnumerable`1 SourceFiles, CppStandardVersion CppStandard, FileReference CompilerPath, DirectoryReference SysRootPath, Dictionary`2 ModuleCommandLines, JsonFile OutFile, DirectoryReference OutputDirectory) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudioCode\VSCodeProjectFileGenerator.cs:line 670
   at UnrealBuildTool.VSCodeProjectFileGenerator.WriteCppPropertiesFile(DirectoryReference OutputDirectory, ProjectData Projects) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudioCode\VSCodeProjectFileGenerator.cs:line 656
   at UnrealBuildTool.VSCodeProjectFileGenerator.WritePrimaryProjectFile(ProjectFile UBTProject, PlatformProjectGeneratorCollection PlatformProjectGenerators, ILogger Logger) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudioCode\VSCodeProjectFileGenerator.cs:line 281
   at UnrealBuildTool.ProjectFileGenerator.WriteProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, ILogger Logger) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 2821
   at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String[] Arguments, ILogger Logger) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 1176
   at UnrealBuildTool.GenerateProjectFilesMode.Execute(CommandLineArguments Arguments, ILogger Logger) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:line 233
   at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 648

I read what I can and fix the following

  • Replace ‘IniKeyBlacklist’ with ‘IniKeyDenylist’ in DefaultGame.ini
  • Replace ‘IniSectionBlacklist’ with ‘IniSectionDenylist’ in DefaultGame.ini
  • Installed the ‘TargetSystem’ to the UE5.1 Editor

After those fixes I tried again opening UE5.1 and open the uproject. Asked me if I wanted to continue without the plugins, I accept and eventually the first popup of “MyCustomProject could not be compiled. Try rebuilding from source manually.” showed up again.

This time I went to the folder and do a Folder Reset again, [Generate Visual Studio Files] and now this is the new error that appears when doing that, which I think is related / it’s the same the error displayed before. Note that this error interrupts the generation of visual studio files.

Binding IntelliSense data... 100%
Writing project files...
Writing project files... 67%
Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at UnrealBuildTool.VSCodeProjectFileGenerator.WriteConfiguration(String Name, String ProjectName, IEnumerable`1 SourceFiles, CppStandardVersion CppStandard, FileReference CompilerPath, DirectoryReference SysRootPath, Dictionary`2 ModuleCommandLines, JsonFile OutFile, DirectoryReference OutputDirectory) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudioCode\VSCodeProjectFileGenerator.cs:line 670
   at UnrealBuildTool.VSCodeProjectFileGenerator.WriteCppPropertiesFile(DirectoryReference OutputDirectory, ProjectData Projects) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudioCode\VSCodeProjectFileGenerator.cs:line 656
   at UnrealBuildTool.VSCodeProjectFileGenerator.WritePrimaryProjectFile(ProjectFile UBTProject, PlatformProjectGeneratorCollection PlatformProjectGenerators, ILogger Logger) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudioCode\VSCodeProjectFileGenerator.cs:line 281
   at UnrealBuildTool.ProjectFileGenerator.WriteProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, ILogger Logger) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 2821
   at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String[] Arguments, ILogger Logger) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 1176
   at UnrealBuildTool.GenerateProjectFilesMode.Execute(CommandLineArguments Arguments, ILogger Logger) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:line 233
   at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 648

If you want me to provide any extra information or log, I’d be happy to edit the post. Thank you for your time.

— UPDATE 1 —
A Reddit user noticed that the editor was using VS code. I opened an empty 5.1 project switched to Visual Studio 2022 and now I’m able to generate a solution. I open it in Visual Studio 2022 (because 2019 shows that’s incompatible) but when I try to build, this error shows up. (I took some liberties with formatting so it can be more readable).

Code:
MSB3073

Description:
The command "D:\Editors\UE_5.1\Engine\Build\BatchFiles\Build.bat MahouPrototypeEditor Win64 Development -Project="D:\MyCustomProject\depot\MahouPrototype.uproject" -WaitMutex -FromMsBuild" exited with code 6.

File:
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets

Line:
44

Searching on internet, I found out that this error happens when there are instances of unreal running or live coding is enabled. I deactivated live coding in UE5.1 and just to be sure rebooted my PC.

I also checked for all possible dependencies like having installed .NET 6 but I already checked it. I even uninstalled a installed from scratch everything and be sure of installing the correct dependencies. I’m stuck.

1 Like

In your target files make sure to set the correct build order after the upgrade
example

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class StaminaCPPTarget : TargetRules
{
	public StaminaCPPTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Game;
		DefaultBuildSettings = BuildSettingsVersion.V5;
		IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_1;
		ExtraModuleNames.Add("StaminaCPP");
	}
}

The IncludeOrderVersion segment is crucial for it to build and compile correctly after an upgrade.
You have two targets the game and the editor, both need this

I finally figured it out. I only had to open the project in 5.0, go to plugins and disable all the ones installed, including those installed in the editor. After that, the game was unplayable with an expected huge amount of errors. After that, close the project, and proceed to delete .vs, Binaries, Intermediate, and Saved folders. Don’t forget to also delete the .sln. After that, switch to the new unreal engine version of choice, compile from Visual Studio 2022. Doing it this way the game will finally compile. After that, you want to install all the plugins you disabled with the updated versions for the new Unreal Engine (I had all plugins for 4.27 and 5.0, so I had to updated all of them). After installing all of them, open the project, enable all the plugins back, reset the editor and the project should be working properly now.

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