.NET Framework 引用 .NET Standard類庫時致出現:未能加載文件或程序集的異常

.NET Framework 引用 .NET Standard類庫時致出現System.IO.FileNotFoundException: 未能加載文件或程序集 的異常

問題描述

.NET Framework 引用 .NET Standard類庫時,依賴項不能從standard流向framework導致出現 System.IO.FileNotFoundException: 未能加載文件或程序集 的異常

解決方案:

在 .net framework項目的工程文件(csproj)中配置:

<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

參考

Referencing a .net standard class library project in .net Framework web app and System.IO.FileNotFoundException throws

Dependencies don’t flow from new NETStandard project to old Desktop projects through ProjectReferences

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章