Visual Studio 2017 Class 库项目:无法加载文件或程序集 System.IO.FileSystem
Visual Studio 2017 Class Library Project: Could not load file or assembly System.IO.FileSystem
我正在用 c# 开发 .NETStandard Class 库,然后使用 .NET Framework 单元测试项目对其进行测试。问题代码行是;
using System.IO;
/*
* Returns true if @strFile points to a file on the system,
* Otherwise Returns False
*
*/
private Boolean checkFileExists(string strFile)
{
return File.Exists(strFile);
}
抛出异常:
System.IO.FileNotFoundException: 无法加载文件或程序集 'System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 或其依赖项之一。系统找不到指定的文件。
如何确保 class 库项目可以找到该库?
谢谢
单击下面的链接查看步骤图片
In Visual Studio, Select Tools/NuGet Package Manager/Package Manager Console
enter this at nuget Command Line
这将安装来自 Microsoft 的最新 System.IO.FileSystem 软件包。
我正在用 c# 开发 .NETStandard Class 库,然后使用 .NET Framework 单元测试项目对其进行测试。问题代码行是;
using System.IO;
/*
* Returns true if @strFile points to a file on the system,
* Otherwise Returns False
*
*/
private Boolean checkFileExists(string strFile)
{
return File.Exists(strFile);
}
抛出异常: System.IO.FileNotFoundException: 无法加载文件或程序集 'System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 或其依赖项之一。系统找不到指定的文件。
如何确保 class 库项目可以找到该库?
谢谢
单击下面的链接查看步骤图片
In Visual Studio, Select Tools/NuGet Package Manager/Package Manager Console
enter this at nuget Command Line
这将安装来自 Microsoft 的最新 System.IO.FileSystem 软件包。