When I try to create a blank C++ project I got the following error:
Unhandled exception: BadImageFormatException: Bad IL format. The format of the file ‘C:\work\Unreal Projects\QuickStart\Intermediate\Build\BuildRules\QuickStartModuleRules.dll’ is invalid.
Seems like a problem with .Net. To be sure that the right .Net versions are installed I consulted
Unreal Engine 5.5 Release Notes | Unreal Engine 5.5 Documentation | Epic Developer Community
and found the following:
- .NET 4.6.2 Targeting Pack
- .NET 8.0
I installed just that on my machine and removed other .Net versions but still get the same failure.
The exact failure from the console:
Running C:/Program Files/Epic Games/UE_5.5/Engine/Build/BatchFiles/Build.bat -projectfiles -project=“C:/work/Unreal Projects/QuickStart/QuickStart.uproject” -game -rocket -progress
Using bundled DotNet SDK version: 8.0.300
Running UnrealBuildTool: dotnet “....\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” -projectfiles -project=“C:/work/Unreal Projects/QuickStart/QuickStart.uproject” -game -rocket -progress
Log file: C:\Users\XXX\AppData\Local\UnrealBuildTool\Log_GPF.txt
Generating VisualStudio project files:
Discovering modules, targets and source code for project…
Available x64 toolchains (1):
- C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808
(Family=14.43.34808, FamilyRank=1, Version=14.43.34810, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64)
Visual Studio 2022 compiler version 14.43.34810 is not a preferred version. Please use the latest preferred version 14.38.33130
Total execution time: 1.32 seconds
Unhandled exception: BadImageFormatException: Bad IL format. The format of the file ‘C:\work\Unreal Projects\QuickStart\Intermediate\Build\BuildRules\QuickStartModuleRules.dll’ is invalid.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFile(String path)
at UnrealBuildTool.DynamicCompilation.CompileAssembly(FileReference OutputAssemblyPath, IEnumerable1 SourceFileNames, ILogger Logger, IEnumerable
1 ReferencedAssembies, IEnumerable1 PreprocessorDefines, Boolean TreatWarningsAsErrors) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\DynamicCompilation.cs:line 289 at UnrealBuildTool.DynamicCompilation.CompileAndLoadAssembly(FileReference OutputAssemblyPath, IEnumerable
1 SourceFileNames, ILogger Logger, IEnumerable1 ReferencedAssembies, IEnumerable
1 PreprocessorDefines, Boolean DoNotCompile, Boolean ForceCompile, Boolean TreatWarningsAsErrors) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\DynamicCompilation.cs:line 351
at UnrealBuildTool.RulesAssembly..ctor(RulesScope Scope, IReadOnlyList1 BaseDirs, IReadOnlyList
1 Plugins, IReadOnlyDictionary2 ModuleFileToContext, IReadOnlyList
1 TargetFiles, FileReference AssemblyFileName, Boolean bContainsEngineModules, Nullable1 DefaultBuildSettings, Boolean bReadOnly, Boolean bSkipCompile, Boolean bForceCompile, RulesAssembly Parent, ILogger Logger) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 191 at UnrealBuildTool.RulesCompiler.<>c__DisplayClass9_0.<CreateProjectRulesAssembly>b__0(FileReference _) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\RulesCompiler.cs:line 332 at System.Collections.Concurrent.ConcurrentDictionary
2.GetOrAdd(TKey key, Func2 valueFactory) at UnrealBuildTool.RulesCompiler.CreateProjectRulesAssembly(FileReference ProjectFileName, Boolean bUsePrecompiled, Boolean bSkipCompile, Boolean bForceCompile, ILogger Logger) in D:\build\++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\RulesCompiler.cs:line 247 at UnrealBuildTool.ProjectFileGenerator.AddProjectsForAllTargets(PlatformProjectGeneratorCollection PlatformProjectGenerators, List
1 AllGames, List1 AllTargetFiles, String[] Arguments, List
1 EngineProjects, List1 GameProjects, Dictionary
2 ProjectFileToUProjectFile, Dictionary2 ProgramProjects, Dictionary
2 RulesAssemblies, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 2791
at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String Arguments, Boolean bCacheDataForEditor, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 1048
at UnrealBuildTool.GenerateProjectFilesMode.ExecuteAsync(CommandLineArguments Arguments, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:line 260
at UnrealBuildTool.UnrealBuildTool.Main(String ArgumentsArray) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 687
Can anyone help me with this issue?
Thank you very much