Thank you for reaching out.
The error Failed to load hostfxr.dll (HRESULT: 0x80070017) means the app cannot read the required runtime file. This usually happens because:
- Files in the published folder are corrupted or incomplete.
- Antivirus or security services block or modify files after first run.
- On Windows 7, missing SHA‑2 support (KB4457144 update) prevents .NET 9 apps from running.
- Disk or copy errors during deployment.
Steps you can try
- Verify published files
- Re-publish the app as Self-contained for the correct OS architecture (x64/x86).
- Copy files using a reliable method (avoid partial ZIP extraction).
- Check OS prerequisites
- Windows 7: Install https://support.microsoft.com/help/4457144 for SHA‑2 code signing support.
- Windows 10: No extra patch needed, but ensure latest updates are installed.
- Run as Administrator
- Right-click the
.exe→ Run as Administrator to avoid permission issues.
- Right-click the
- Disable antivirus temporarily
- Some security tools block
hostfxr.dll. Test after disabling antivirus/firewall.
- Some security tools block
- Repair corrupted files
- If error persists, delete the app folder and copy fresh files from the publish output.
- Check Event Viewer logs
- Look for disk errors or security service interference (Software Protection Service restart).
Tips:
- Always publish with
dotnet publish -r win10-x64 --self-contained true. - Use single-folder deployment and verify integrity before shipping.
- Avoid modifying files after publishing.
Please let us know if you require any further assistance, we’re happy to help.
If you found this information useful, kindly mark this as "Accept Answer".