我有一个引用外部库(System.Runtime.Loader,从 NuGet 获取)的 NetStandard 1.6 库。如果我从 Net Framework 4.7 Windows 应用程序引用我的 NetStandard 库,我会在运行 Net Framework 应用程序时收到 System.IO.FileNotFoundException。
完全异常:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'
现在,我完全了解异常消息的含义,但对于如何在这种情况下解决它还一头雾水。
想法?
最佳答案
我建议你右击visual studio解决方案,去manage nuget packages for the solution并检查你拥有的各种库的版本。库之间的任何冲突都将出现在“合并”选项卡中。或者,尝试从项目的引用文件夹中删除库引用并将其添加回来。
关于c# - NetStandard/Net Framework 引用 hell ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45439987/