Are you seeing an error message ‘Bad image. Error code- 0xc000012f ‘ on your computer screen? This error code is usually popping up when you try to open an image file of the wrong format on your computer. As corrupted visual studio files cause this issue, uninstalling and re-installing the visual studio will fix this issue on your computer.
Fix-1 Delete older DLL file-
Deleting the older DLL file from your computer and substituting it with a new one may fix the issue.
1. Press Windows key+R to launch Run.
2. To visit the System32 folder, copy-paste this line in Run window and hit Enter.
C:\Windows\System32
3. When the System32 folder, scroll down to find “msvcp140.dll“.
4. Right-click on the “msvcp140.dll” file and then click on “Delete“.
*After deleting the file, close the File Explorer window.
5. Press Windows key+R to launch Run window.
6. Now, type “msinfo32” and hit Enter.
System Configuration window should open.
7. In System Configuration window, check “System Type” on the right-hand side of the window.
(Simply note whether it is “x64-based PC” or “x32-based PC“). This will help you to download specified architecture.
8. You have to download the MSVCP140.dll on your computer.
9. According to the “Bits” (CPU-architecture, -x64 bit or -x32 bit) of your computer click on “Download“.
Once the downloading process is complete, close the browser window.
10. Go to the download location on your computer.
11. After the download is complete, extract it in a favorable location of your choice.
12. Now what you need to do is to go to the folder where you have extracted the .dll file
After that, copy the “msvcp140.dll” file.
13. Again, press Windows key+R to launch Run.
14. Now, type this line in Run window and hit Enter.
C:\Windows\System32
Note– Replace “C:” with the drive letter of your Windows installation drive.
15. Now, paste the “msvcp140.dll” file in the System32 folder.
(If you are prompted for permission to make changes, click on “Continue“).
Now, close the File Explorer window.
You must restart your computer to let the changes take effect on your computer.
*NOTE–
If you come across any error message trying to delete the DLL file, there is a permissions issue.
Follow these easy steps to solve the issue-
1. Right-click on “msvcp140.dll” and then click on “Properties“.
2. In the Properties window, go to the “Security” tab.
3. Now, click on the “Advanced” option.
4. Now, go to the “Auditing” tab.
5. Click on “Continue“.
6. Next, select the first term on ‘Permission entries:‘ panel. (We have selected the “SYSTEM” term. )
7. Now, click on “Disable inheritance“.
8. Simply click on “Convert inherited permissions into explicit permissions on this object.” to disable the inheritance.
9. Coming back to the ‘Permissions entries:‘ tab, select the first term. (We have selected the “SYSTEM” term. )
10. Now, click on “Remove“.
11. This way, select each of the terms on ‘Permission entries:‘ tab and then click on “Remove” to sequentially empty the list.
12. Now, click on “Change“.
13. Click on “Advanced“.
14. Now, click on “Find Now“.
15. Then scroll down through the list of groups or users, select your user name. (For this computer it is “Sambit“.)
16. Click on “OK“.
17. Again click on “OK“.
18. Then, click on “Add“.
19. Now, click on “Select a principal“.
20. Click on “Advanced“.
21. Now, click on “Find Now“.
22. Then scroll down through the list of groups or users, select your user name. (For this computer it is “Sambit“.)
23. Click on “OK“.
24. Again click on “OK“.
25. Now, select the “Full control“.
26. Then, click on “OK“.
27. Finally, click on “Apply” and then on “OK“.
28. In the Security tab, click on “Apply” and then on “OK“.
Now, you can delete the DLL file from your computer and follow the steps to substitute with a new DLL file.
Fix-2 Reinstall Microsoft Visual C++ 2015 Redistributable-
Uninstalling and reinstalling Microsoft Visual C++ 2015 Redistributable packages can do the trick.
Steps to install visual studio on your computer-
Follow these steps to uninstall visual studio packages from your computer-
1. Press the Windows key and start to type “Programs and Features“.
2. Then, click on the “Programs and Features” to access the Programs and features.
3. Now, you need to right-click on “Microsoft Visual C++ 2015 Redistributable” and then click on “Uninstall“.
4. Then, click on “Uninstall“.
5. Same way, scroll down through the list of installed applications and packages, right-click on “Microsoft Visual C++ 2015 Redistributable(x86)” and then click on “Uninstall“.
6. Now, in the Microsoft Visual C++ 2015 Redistributable Setup window, click on “Uninstall“.
When the uninstallation process is complete, click on “Close” to close the Setup window.
Steps to install visual studio on your computer-
Follow these steps to install the latest version of Visual Studio on your computer-
1. Now you need to download the latest version of Visual C++ Redistributable for Visual Studio 2015.
2. You have to click on “File Name“.
3. Then, click on “Next” to start the downloading process.
4. Now, go to the downloaded location on your computer.
5. Double click on “vc_redist.x64” to start the installation process.
6. Then you need to check the statement “I agree to the license terms and conditions“.
7. Once you have done so, click on “Install” to start the installation process.
In a few minutes, the installation process will be completed.
8. Same way, go to the download location and then double click on “vc_redist.x86” to open the setup window on your computer.
9. Similarly, check the statement “I agree to the license terms and conditions“.
10. Again, click on “Install” to install this Visual C++ Library.
When the installation is complete, click on “Close” to complete the installation on your computer.
Restart your computer to complete the installation process.
After rebooting your computer, try to run the application again.