Unhandled exception: BadImageFormatException: Bad IL format. The format of the file 'XXXModuleRules.dll' is invalid.

Hello again!

That’s good, the compiler error is gone, now we just need to sort out “BadImageFormatException”. Since the error call aims at QuickStartModuleRules.dll, the process is most likely clashing with with corrupt or missing elements tied to .NET assembly.

As first approach, please test deleting the Intermediate and Binaries folders, then regenerate the project files. If the issue remains active after that, delete the DerivedDataCache, and repeat the process.

Alternatively, since you are currently working with .NET 8.0.300, it would be worth a shot downgrading to .NET 6.0, which is currently the recommended version for UE5 (Download .NET 6.0 (Linux, macOS, and Windows) | .NET).