.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>