Share this article

Improve this guide

Fix ‘An attempt was made to load a program with an incorrect format’

4 min. read

Updated onMarch 26, 2024

updated onMarch 26, 2024

Share this article

Improve this guide

Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more

Key notes

If you’re getting theERROR_BAD_FORMATerror code 11 with theAn attempt was made to load a program with an incorrect formatdescription, follow the troubleshooting steps listed in this article to fix it.

ERROR_BAD_FORMAT: Background

The errorAn attempt was made to load a program with an incorrect formatis quite a mysterious error code. There is not much information about it, except for various forum posts where users describe the problem.

TheERROR_BAD_FORMATerror code affects mainlyWindows 7 machines, but sometimes it can also occur on Windows 10. It usually occurs when users try to launch an app or program on their Windows PCs or servers.

Error code 11 is often triggered by VS Redistributable package issues, incompatibility problems between programs, incorrect registry changes, etc.

How to fix error 10: ERROR_BAD_FORMAT

How to fix error 10: ERROR_BAD_FORMAT

ERROR_BAD_FORMAT on .NET platforms

Solution 1 — Enable 32-bit compatibility

Users report that this error mainly occurs due toDLL incompatibility issuestriggered by apps running in Visual Studio installed on 64-bit operating systems with the value TargetCPU = Any CPU. In other words, apps try to loadDLLsbuilt for 32-bit platforms on x64 computers, and vice versa.

To fix this problem, you need to configure the utility to run as a 32-bit .NET process usingCORFLAGS.

You can also enable 32-bit compatibility in the Windows form application. Simply right-click on Project > go to Properties > Build > check Prefer 32-bit.

Additionally, you can also use theAny CPUoption, and use a dedicated code to identify whichDLLto use. In this manner, you will use one assembly to handle both 32-bit and 64-bit platforms. Here is the code to use:

if (Environment.Is64BitProcess){//call MiniDumpWriteDump}else{//call MiniDumpWriteDumpX86}

You can also use preprocessor conditions, but in this case you need to compile two different assemblies. In other words, compile a 32-bit assembly for 32-bit platforms, and a separate 64-bit assembly for 64-bit platforms.

Solution 2 — Install the correct VS Redistributable Package

Your target PC might not have the appropriate VS Redistributable Package installed. Go toMicrosoft’s webpageand install the appropriate VS Redistributable Package version on your system.

Fix ERROR_BAD_FORMAT on Windows 10

On Windows 10, theAn attempt was made to load a program with an incorrect formaterror usually occurs on startup and is due to software incompatibility issues. Users confirm that this problem often occurs when using Start Menu replacement tools.

If you’re using a Windows 10 Start menu replacement, uninstall it and that should do the trick.

Also, don’t forget torepair your registry. You can use Microsoft’s System File Checker to check for system file corruption. Here’s how to run an SFC scan:

  1. Go to Start > typecmd> right-click Command Prompt > select Run as Administrator

  2. Now type thesfc /scannowcommand

  3. Wait for the scanning process to complete and then restart your computer. All corrupted files will be replaced on reboot.

The simplest way to repair your registry is to use a dedicated tool. Don’t forget to first backup your registry in case anything goes wrong. If you haven’t installed any registry cleaner on your computer, check out our article onthe best registry cleaners to useon Windows 10 PCs.

The ERROR_BAD_FORMAT error code can lead to damaged Windows files and compromised registry values. Repairing and replacing them is important in order to restore your PC’s condition and boost its performance.

Areliable automated toolcan help you achieve this and keep your device safe beyond standard security updates.

We hope that the solutions listed above helped you fix theERROR_BAD_FORMATerror code 11. As always, if you’ve come across other solutions to fix this problem, you can list the troubleshooting steps in the comments below.

More about the topics:System Errors

Madalina Dinita

Networking & Security Specialist

Madalina has been a Windows fan ever since she got her hands on her first Windows XP computer.

She is interested in all things technology, especially emerging technologies – AI and DNA computing in particular.

Prior to joining the WindowsReport team, she worked in the corporate world for a number of years.

User forum

0 messages

Sort by:LatestOldestMost Votes

Comment*

Name*

Email*

Commenting as.Not you?

Save information for future comments

Comment

Δ

Madalina Dinita

Networking & Security Specialist

Madalina is a Windows fan since forever, especially interested in AI, emerging technologies, privacy, and security.