How to solve the pesky "not designed to run on your OS" Visual C++ error

Should you encounter an issue with some software or games where a specific file error shows up with "this is not designed to run on your OS," we're going to look at a few things you can try out to fix it.

The issue I had was with mfc140u.dll, which is part of Microsoft's Visual C++ redistribution suite, the 2015 version in my case. The GOG Galaxy client can sometimes stumble with this issue, which has caused gamers to take to online forums to try and get some assistance.

I browsed around and worked with a few people to see if we could come across a fix since everything we tried up until that point failed to solve our problem. Here's what we came up with.

MFC Error

Re-install VC

The first step we need to take is to re-install the Visual C++ redistribution suite that may have been packaged with the game or software you're attempting to run. This may be causing the issue, but luckily Microsoft has made it easy to fetch and install a fresh version.

  1. Download the VC redis that matches the error you're encountering (in our case it was mfc140u.dll, but other .dll file errors may be associated with older versions).
  2. Run the install executable.
  3. Choose "repair".
  4. Reboot.

If that fixed the issue then you should be good to go. If not, or if this error occurred again after a few more launches, try a full re-install:

  1. Re-run the downloaded executable.
  2. Choose "Uninstall".
  3. Reboot.
  4. Close down your anti-virus software.
  5. Run the executable again.
  6. Follow the wizard and complete the process.

If the above still doesn't work, try uninstalling the redis package and the software/game you're attempting to run. Then reboot your system and re-install the redis package, followed by the software/title.

Cleansing the registry

When attempting to re-install VC on my machine, I would be met with a different error, which related to the installer not being able to locate some files. Deleting a registry entry or two before re-installing VC is what appeared to not only solve this new issue, but also the error prompt I was trying hard to address as well.

This may work for you if all other options fail. I uninstalled Microsoft Visual C++ 2015 before carrying out these following steps, which will remove Visual C++ 2015 registry keys from your machine. You should always take extra care when dealing with the Windows registry, as deleting the wrong thing can negatively impact system stability.

  1. Hit Windows Key + R.
  2. Type in "regedit".
  3. Hit OK.
  4. Navigate to "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products".

MSVC

  1. Manually choose each listing within this folder until you come across any with "Microsoft Visual C++ 20XX" under "ProductName".
  2. For these entries you find, right-click on each one.
  3. Choose "Export".
  4. Once again right-click the listing.
  5. This time, choose "Delete".

Reboot your PC and run the Visual C++ executable.

Contact Microsoft

If you're still stumped and have exhausted all other avenues, it's time to contact the Microsoft Community. Head to the official forum and see if someone can lend a hand.

Rich Edmonds
Senior Editor, PC Build

Rich Edmonds was formerly a Senior Editor of PC hardware at Windows Central, covering everything related to PC components and NAS. He's been involved in technology for more than a decade and knows a thing or two about the magic inside a PC chassis. You can follow him on Twitter at @RichEdmonds.