我试图在我的System.IO.Compression程序中使用C#程序集。我目前正在运行CentOS 7,安装了最新版本的mono。
当试图在ZipFile中使用System.IO.Compression类时,我会得到以下错误:
Program.cs(48,21):error CS0103:名称“`ZipFile”在当前上下文编译中不存在失败:1错误,0警告
这是因为由于某些原因,默认情况下不包括System.IO.Compression,因此您必须添加程序集引用,而且我可以通过解决方案资源管理器在Visual中添加程序集引用,但在mono中,我无法添加它。在您说之前,是的,我添加了一行“使用System.IO.Compression;”。
如果有人对如何将此程序集引用添加到mono中有任何见解,将不胜感激。
发布于 2018-02-03 01:11:50
我有一个类似的问题,并在问题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
https://stackoverflow.com/questions/46283274
复制相似问题