【问题标题】:system.io.stream not found in Visual Studio 2017 [closed]在 Visual Studio 2017 中找不到 system.io.stream [关闭]
【发布时间】:2017-08-14 23:07:12
【问题描述】:

我正在使用 Visual Studio 2017 社区版。我在制作 C# 项目时被卡住了,因为我无法使用 System.IO.Stream。

using System.Xml.Serialization; 
using System.Runtime.Serialization.Formatters.Binary;
using System.IO.Stream;

Here is what it shows

【问题讨论】:

  • System.IO.Stream,在Stream 中大写S。请在将来的实际问题中包含代码,而不是代码的屏幕截图。
  • 我什至用了大写S,但它也不起作用。无论如何,我添加了一张显示错误的新图片。另外,感谢您的建议,我添加了有问题的代码。

标签: c# visual-studio-2017 system.io.file


【解决方案1】:

命名空间实际上是 System.IO 用 System.IO 替换 System.IO.Stream Stream 是一个类,而不是命名空间

【讨论】:

  • 这在 2017 年对我有用
【解决方案2】:

C#区分大小写,命名空间为System.IO.Stream

您还需要在 using 语句中包含 static,因为 Stream 是一个类

using static System.IO.Stream;

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2017-09-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-02-01
  • 2018-05-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多