最近看到.net core 3支持wpf了,嘗試一下(若是可行,會特別利於脫離.net運行時)html
dotnet new wpf dotnet publish -c Release -r win-x86
拷貝win-x86\publish目錄到目標測試機(win7 x86)結果不能運行,提示安全
dotnet部署出現Failed to load the dll from [ ... hostfxr.dll], HRESULT: 0x80070057
KB2533623
補丁前往
Microsoft 安全公告:不安全的庫加載可能容許遠程執行代碼
選擇對應操做系統版本補丁,安裝重啓,搞定!測試
ps.
想起6年前的嘗試
簡單方法打包.net程序集脫離framework
仍是官方的方案最方便;-)操作系統