【问题标题】:'GZipStream' could not be found - reference issue找不到“GZipStream” - 参考问题
【发布时间】:2014-01-10 10:56:44
【问题描述】:

我无法在我的 C# ASP.NET 4.5 应用程序中使用 GZipStream 类。

我得到错误:

找不到类型或命名空间名称“GZipStream”(您是否缺少 using 指令或程序集引用?)

我尝试使用 using System.IO;,但 System.IO.Compression 在 Visual Studio 的“参考管理器”中不可用。我右键单击对象名称以查看 Visual Studio 是否找到相关引用,但没有。

有什么建议吗?

【问题讨论】:

  • 它不在System.IO.Compression.dll(用于ZIP 档案)、GZipStream 中,而是在System.dll 程序集中。添加using System.IO.Compression
  • 添加你的答案,我会接受
  • 您可以接受 Ozik 的回答,内容大致相同。

标签: c# asp.net gzipstream


【解决方案1】:

需要添加对System.dll 程序集和using System.IO.Compression 命名空间的引用。

MSDN:GZipStream Class

【讨论】:

  • 对,但我猜他已经引用了 System.dll! :)
【解决方案2】:

命名空间与dll名称不一样,需要在程序集中添加dll引用,System.IO.Compression.FileSystem.dll

【讨论】:

  • 不,System.IO.Compression.FileSystem 程序集用于 ZipFile 而不是 simple gzip 流(它只是在 System.dll 中)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多