在 CentOS 7 上将 System.IO.Compression 程序集添加到 Mono
Adding System.IO.Compression assembly to Mono on CentOS 7
我试图在我的 C# 程序中使用 System.IO.Compression 程序集。我目前是 运行 CentOS 7,安装了最新版本的单声道。
尝试在 System.IO.Compression 中使用 ZipFile class 时,出现以下错误:
Program.cs(48,21): error CS0103: The name `ZipFile' does not exist in the current context Compilation failed: 1 error(s), 0 warnings
这是因为由于某些原因 System.IO.Compression 默认情况下不包括在内,所以您必须添加程序集引用,我能够通过解决方案资源管理器在 Visual Studio 中这样做但是在单声道我没有办法添加它。
在你说之前,是的,我添加了行 "using System.IO.Compression;".
如果有人对如何将此程序集引用添加到单声道有任何见解,我们将不胜感激。
我遇到了类似的问题,在问题I didn't find "ZipFile" class in the "System.IO.Compression" namespace
中找到了解决方案
解决方案是引用 System.IO.Compression.FileSystem.dll
例如。 mcs /reference:System.IO.Compression.FileSystem.dll Main.cs
我试图在我的 C# 程序中使用 System.IO.Compression 程序集。我目前是 运行 CentOS 7,安装了最新版本的单声道。
尝试在 System.IO.Compression 中使用 ZipFile class 时,出现以下错误:
Program.cs(48,21): error CS0103: The name `ZipFile' does not exist in the current context Compilation failed: 1 error(s), 0 warnings
这是因为由于某些原因 System.IO.Compression 默认情况下不包括在内,所以您必须添加程序集引用,我能够通过解决方案资源管理器在 Visual Studio 中这样做但是在单声道我没有办法添加它。 在你说之前,是的,我添加了行 "using System.IO.Compression;".
如果有人对如何将此程序集引用添加到单声道有任何见解,我们将不胜感激。
我遇到了类似的问题,在问题I didn't find "ZipFile" class in the "System.IO.Compression" namespace
中找到了解决方案解决方案是引用 System.IO.Compression.FileSystem.dll
例如。 mcs /reference:System.IO.Compression.FileSystem.dll Main.cs