To run this app you need a newer version of .Net core.

Khaled Haniche 0 Reputation points
2025-08-15T17:48:55.8066667+00:00

i launched my app after that i got error code 0xc000012f bad image in C:\Program Files\dotnet\host/fxr/ hostfxr.dll after that i download new hostfxr dll file and replace it to the old file i open the my app it give another error is: to run this app you need a newer version of .Net core. would you like to download it now.

i press ok and i download it i launch my app again the problem didnt solved

Windows Insider program | Program announcements and registration | Communications and announcements
0 comments No comments

1 answer

Sort by: Most helpful
  1. Clary-N 15,730 Reputation points Microsoft External Staff Moderator
    2025-08-16T01:15:48.8233333+00:00

    Hi Khaled Haniche,

    Thank you for reaching out Microsoft Q&A regarding the issue you encountered while launching your application.

    I understand that you received the error code 0xc000012f (Bad Image) related to hostfxr.dll, followed by a prompt to install a newer version of .NET Core. Even after replacing the DLL and installing the suggested runtime, the issue persists.

    To help resolve this, I recommend the following steps:

    Step 1: Run System File Checker and DISM

    -Open Command Prompt as Administrator and run:

    sfc /scannow 
    DISM.exe /Online /Cleanup-image /Restorehealth
    

    -Restart your device to apply changes then check again.

    Step 2: Reinstall .NET Runtime

    Uninstall all existing .NET runtimes via Control Panel.

    Step 3: Install Visual C++ Redistributables

    Please ensure the latest supported Visual C++ Redistributables are installed:

    https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

    Step 4: Perform a Clean Boot

    This helps rule out third-party software conflicts:

    -Press Win + R, type msconfig, and press Enter.

    • Under Services, check "Hide all Microsoft services" and click Disable all.
    • Under Startup, open Task Manager and disable all items.

    Restart your PC and try launching the app again.

    *Disclaimer: A "clean boot" starts Windows with a minimal set of drivers and startup programs. It helps to determine whether a background service is interfering with your game or program and to isolate the cause of a problem. 

    These steps of "clean boot" might look complicated at first glance. However, to avoid any trouble for you, please follow them in order and step-by-step so that it will help you get back on track.

    In case the issue still persists, please let me know the exact application you're using and whether your app targets a specific .NET Core version. I’ll be happy to assist further.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.