UE5.6 C++项目升级UE5.7时用Rider加载项目失败的解决办法

书接上文《UE5.6 C++项目升级UE5.7时生成sln失败的解决办法》用Rider 打开项目以后显示游戏项目和引擎项目都加载失败,以下是解决办法

错误截图

Log内容

UnrealBuildTool failed with exit code 0x00000006

bash 复制代码
17:32:31.841: dotnet.exe "G:\Unreal Engine\UE_5.7\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" -ProjectFiles -Rider -Automated -Minimize -NoMutex -Log=C:\Users\XXXXX\AppData\Local\JetBrains\Rider2025.3\log\UBT_GPF.txt -Platforms=Win64 -TargetTypes=Editor -TargetConfigurations=Development D:\UE5-CPP-RPGGame\RPGGame\RPGGame.uproject
17:32:32.197: Log file: C:\Users\XXXXX\AppData\Local\JetBrains\Rider2025.3\log\UBT_GPF.txt
17:32:32.365: Generating Rider project files:
17:32:32.663: Writing project files...
17:32:32.663: Warning: [Upgrade]
17:32:32.663: Warning: [Upgrade] Using backward-compatible build settings. The latest version of UE sets the following values by default, which may require code changes:
17:32:32.663: Warning: [Upgrade]     WindowsPlatform.bStrictInlineConformance = true        => Updates MSVC inline conformance (Remove unreferenced COMDAT) to true (Previously: false).
17:32:32.663: Warning: [Upgrade]     UndefinedIdentifierWarningLevel = WarningLevel.Error   => Enables compile-time validation of undefined identifiers in conditional expressions. (Previously: Off).
17:32:32.663: Warning: [Upgrade] Suppress this message by setting 'DefaultBuildSettings = BuildSettingsVersion.V6;' in RPGGameEditor.Target.cs, and explicitly overriding settings that differ from the new defaults.
17:32:32.663: Warning: [Upgrade]
17:32:32.663: Warning: [Upgrade]
17:32:32.663: Warning: [Upgrade] Using backward-compatible include order. The latest version of UE has changed the order of includes, which may require code changes. The current setting is:
17:32:32.663: Warning: [Upgrade]     IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_6
17:32:32.663: Warning: [Upgrade] Suppress this message by setting 'IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_7;' in RPGGameEditor.Target.cs.
17:32:32.663: Warning: [Upgrade] Alternatively you can set this to 'EngineIncludeOrderVersion.Latest' to always use the latest include order. This will potentially cause compile errors when integrating new versions of the engine.
17:32:32.663: Warning: [Upgrade]
17:32:32.772: Wrote partial receipt to D:\UE5-CPP-RPGGame\RPGGame\Binaries\Win64\RPGGameEditor.target
17:32:32.772: Exception while generating include data for Target:RPGGameEditor, Platform: Win64, Configuration: Development
17:32:32.772: RPGGameEditor modifies the values of properties: [ UndefinedIdentifierWarningLevel: Off != Error ]. This is not allowed, as RPGGameEditor has build products in common with UnrealEditor.
17:32:32.772: Remove the modified setting, change RPGGameEditor to use a unique build environment by setting 'BuildEnvironment = TargetBuildEnvironment.Unique;' in the RPGGameEditorTarget constructor, or set bOverrideBuildEnvironment = true to force this setting on.
17:32:40.330: Writing project files... 100%
17:32:40.381: Generating QueryTargets data for editor...
17:32:40.383: Compiling Rules Assemblies 100%
17:32:40.392: Writing Query Target Info 100%
17:32:40.392: Generating QueryTargets data for editor took 0.01s
17:32:40.395: Result: Succeeded
17:32:40.395: Total execution time: 8.44 seconds

原始RPGGameTarget.cs

csharp 复制代码
// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

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

原始RPGGameEditorTarget.cs

csharp 复制代码
// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class RPGGameEditorTarget : TargetRules
{
	public RPGGameEditorTarget( TargetInfo Target) : base(Target)
	{
		Type = TargetType.Editor;
		DefaultBuildSettings = BuildSettingsVersion.V5;
		IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_6;
		ExtraModuleNames.Add("RPGGame");
	}
}

修改后的RPGGameTarget.cs

csharp 复制代码
// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class RPGGameTarget : TargetRules
{
	public RPGGameTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Game;
		DefaultBuildSettings = BuildSettingsVersion.Latest;
		IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
		ExtraModuleNames.Add("RPGGame");
	}
}

修改后的RPGGameEditorTarget.cs

csharp 复制代码
// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class RPGGameEditorTarget : TargetRules
{
	public RPGGameEditorTarget( TargetInfo Target) : base(Target)
	{
		Type = TargetType.Editor;
		DefaultBuildSettings = BuildSettingsVersion.Latest;
		IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
		ExtraModuleNames.Add("RPGGame");
	}
}
相关推荐
晚霞的不甘2 小时前
Flutter for OpenHarmony 引力弹球游戏开发全解析:从零构建一个交互式物理小游戏
前端·flutter·云原生·前端框架·游戏引擎·harmonyos·骨骼绑定
Thomas_YXQ3 小时前
Unity3D中提升AssetBundle加载速度的详细指南
java·spring boot·spring·unity·性能优化·游戏引擎·游戏开发
朗迹 - 张伟5 小时前
UE5 City Traffic Pro 交通插件学习笔记
笔记·学习·ue5
*小天屎*5 小时前
UE5 项目打包与 Pixel Streaming 浏览器部署指南
ue5·node.js·虚幻引擎
晚霞的不甘7 小时前
Flutter 方块迷阵游戏开发全解析:构建可扩展的关卡式益智游戏
前端·flutter·游戏·游戏引擎·游戏程序·harmonyos
zhangzhangkeji1 天前
UE5 C++(48-3):共享指针的老师讲解的例题。以及 共享指针 TSharedPtr<T, ESPMode> 的源代码
ue5
玉梅小洋1 天前
Unity Muse 完整使用文档:Sprite+Texture专项
unity·ai·游戏引擎
timathy332 天前
Unity Addressable 实现Build时自定义剔除资源组
unity·游戏引擎
暮志未晚Webgl2 天前
UE5Niagara粒子系统性能优化
ue5
努力的小钟3 天前
UObject创建系统深度分析
ue5