When using .Net Standard 1.4 in a library and .Net framework 4.6.1 in and application, unable to load file System.IO.FileSystem, Version=4.0.1.0

为君一笑 提交于 2019-12-04 08:47:59

This usually happens with "classic" csproj projects when referenced projects require overwritten override system defined types but no binding redirects are present that set this up correctly. When installing all the packages into a .net framework app (e.g. NETStandard.Library or NETStandard.Library.NETFramework(for upcoming .NET Standard 2.0)), this should be done automatically.

To force generation of binding redirects, add this to the csproj file of the .NET Framework project (if it is an executable project, the second property should be irrelevant but it doesn't hurt):

<PropertyGroup>
  <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!