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

**URL:** <https://forums.unrealengine.com/t/unhandled-exception-badimageformatexception-bad-il-format-the-format-of-the-file-xxxmodulerules-dll-is-invalid/2493634>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [May 6, 2025, 2:57pm UTC](https://forums.unrealengine.com/t/unhandled-exception-badimageformatexception-bad-il-format-the-format-of-the-file-xxxmodulerules-dll-is-invalid/2493634 "2025-05-06T14:57:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![brs-sebascova](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brs-sebascova/32/1228079_2.png) [@brs-sebascova](https://forums.unrealengine.com/u/brs-sebascova)\
**Post date:** [May 6, 2025, 6:21pm UTC](https://forums.unrealengine.com/t/unhandled-exception-badimageformatexception-bad-il-format-the-format-of-the-file-xxxmodulerules-dll-is-invalid/2493634/2 "2025-05-06T18:21:21Z")

</div>

Hello there @tsi6800!

You are on the right track. Your updated log after the .Net installs has the following call:

> _Visual Studio 2022 compiler version 14.43.34810 is not a preferred version. Please use the latest preferred version 14.38.33130_

This means that your current Visual Studio build is either missing components, or its using invalid ones. You can follow the installation guide from the community, which can be found here:

> **[Setting Up Visual Studio Development Environment for C++ Projects in Unreal...](https://dev.epicgames.com/documentation/en-us/unreal-engine/setting-up-visual-studio-development-environment-for-cplusplus-projects-in-unreal-engine)**
>
> Tips, tricks, and techniques for setting up Visual Studio to work with Unreal Engine.

Additionally, another thread has a detailed explanation for the compiler setup, please follow the steps included:

> [@Packaging error 'detected compiler newer than visual studio 2022' - beginner](https://forums.unrealengine.com/t/packaging-error-detected-compiler-newer-than-visual-studio-2022-beginner/2174644/17):
>
> Hello readers, this is a summary of this thread and how to set-up the compiler for unreal engine and avoid errors, solved by: @Arodi007 and @villinx You will need visual studio installer and visual studio 2022 downloaded in order for unreal engine to be able to compile and package your game build. You must download the SDK (software developement tool) and MSVC (microsoft visual compiler) from visual studio installer. Press ‘modify’ there are tabs at the top, press ‘individual c…

---

_[View the full topic](https://forums.unrealengine.com/t/unhandled-exception-badimageformatexception-bad-il-format-the-format-of-the-file-xxxmodulerules-dll-is-invalid/2493634)._
