MicrosoftSecurityApp.exe Bad Image: Error 0xc0e90002 [Fix]

Get rid of any additional app installations

Reading time icon 4 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

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

Key notes

  • To fix the MicrosoftSecurityApp.exe Bad Image error, uninstall the downloaded Windows Security or switch out of S Mode.
  • The problem arises due to missing or corrupt system files (DLLs) and restrictions enforced by the OS.
  • Keep reading to find out how Windows Report experts fixed things in no time!
fix MicrosoftSecurityApp.exe Bad Image error

Many users reported getting a MicrosoftSecurityApp.exe – Bad Image error, where it states that the System.Xml.Linq.ni.dll file is either not designed to run on Windows or it contains an error.

The error message appears before signing into the PC and is encountered on Windows 11. Even with the error, other apps and processes, both built-in and third-party, continue to run fine.

What is a Bad Image error?

A Bad Image error appears when the files required to run the program are missing or corrupted. Besides, the problem also arises when other apps conflict with the program or access the same set of shared files simultaneously.

How do I fix the MicrosoftSecurityApp.exe Bad Image error?

Before we start with the slightly complex solutions, try these quick ones:

  • Restart the PC and check for improvements.
  • Check for any pending Windows Updates and install them.
  • Disable any third-party antivirus or similar security software installed on the PC.

1. Uninstall the other Microsoft Defender app

  1. Press Windows + I to open Settings, go to Apps from the navigation pane, and then click on Installed apps.installed apps
  2. Locate Microsoft Defender or Windows Security from the list, click the ellipsis next to it, and select Uninstall.uninstall to fix MicrosoftSecurityApp.exe Bad Image
  3. Again, click Uninstall in the confirmation prompt.
  4. Once done, reboot the PC and check whether the MicrosoftSecurityApp.exe Bad Image error disappears.

The most common reason you get the Bad Image error is due to the presence of multiple instances of the built-in antivirus, Windows Security/Microsoft Defender, existing on the PC. So, uninstall the app, and things should be up and running!

2. Repair the corrupt system files

  1. Press Windows + R to open Run, type cmd, and hit Ctrl + Shift + Enter.cmd
  2. Click Yes in the UAC prompt.
  3. Paste the following three DISM commands individually and hit Enter after each: DISM /Online /Cleanup-Image /CheckHealth DISM /Online /Cleanup-Image /ScanHealth DISM /Online /Cleanup-Image /RestoreHealth
  4. Once done, execute this command to run the SFC scan: sfc /scannowsfc scan to fix MicrosoftSecurityApp.exe Bad Image
  5. Finally, reboot the PC for the changes to come into effect.

You will need to repair the corrupt system files in order to fix the MicrosoftSecurityApp.exe Bad Image error. So, run the DISM commands and SFC scan, and the two will automatically replace all problematic system files with their cached copy.

3. Replace the problematic DLL

If it’s the DLL file to blame, you can replace it with another copy from a healthy PC with the same configuration.

Copy the System.Xml.Linq.ni.dll file to a USB drive on the other computer, and then paste it in the following path on the affected PC after deleting the existing version: C:\Windows\assembly\Nativeimages_v4.0.30319_64\System.Xml.Linq\a3c635436ca5e274374c4389b2f1132d\

An easier fix is to use an effective DLL repair tool because it can proceed with this action automatically and spare you further errors.

4. Switch out of S Mode

  1. Press Windows + I to open Settings, select System from the navigation pane, and click on Activation on the right.
  2. Expand the S mode section, and click the Open Store button.open store
  3. Click on Get under Switch out of S mode.switch out to fix MicrosoftSecurityApp.exe Bad Image
  4. Once the confirmation prompt appears, reboot the device and check for improvements.

A few who faced the Bad Image Error Status 0xc0e90002 with Microsoft Office or other third-party apps fixed it by switching out of S Mode, a slightly restrictive OS environment with enhanced security and speed. So, you may try that!

5. Perform an in-place upgrade

  1. Go to Microsoft’s official webpage, select the OS edition and product language, and then download the Windows 11 ISO.windows 11 iso
  2. Run the ISO file and click on Open in the confirmation prompt.
  3. Double-click the setup.exe file.setup.exe
  4. Click Yes in the UAC prompt.
  5. Click Next to proceed.
  6. Now, click on Accept to agree to Microsoft’s license terms.
  7. Finally, verify that the setup reads, Keep personal files and apps, and click the Install button to start the in-place upgrade. It may take 1-3 hours to complete. next

After the in-place upgrade, you shouldn’t encounter the MicrosoftSecurityApp.exe Bad Image error anymore. Remember, this is as good as reinstalling Windows. It will re-download all the critical system files, DLLs, and other built-in components but won’t affect the stored data.

Once you have fixed things, make sure no other DLLs are missing to prevent any app from throwing similar errors.

For any queries or to share what worked for you, drop a comment below.

More about the topics: bad image error