0

I am attempting to make use of the System.IO.Compression assembly in my C# program. I am currently running CentOS 7 with the most recent version of mono installed.

When trying to make use of the ZipFile class within System.IO.Compression, I am getting the following error:

Program.cs(48,21): error CS0103: The name `ZipFile' does not exist in the current context Compilation failed: 1 error(s), 0 warnings

This is because for some reason System.IO.Compression is not included by default, so you have to add the assembly reference, and I was able to do so in Visual Studio through the solution explorer but in mono I have no way to add it. And before you say it, yes, I have added the line "using System.IO.Compression;".

If anyone has any insight on how to add this assembly reference to mono, that would be appreciated.

Leathel
  • 345
  • 4
  • 14

1 Answers1

0

I had a similiar problem and found the solution in the question I didn't find "ZipFile" class in the "System.IO.Compression" namespace

The Solution is to a a reference to System.IO.Compression.FileSystem.dll
eg. mcs /reference:System.IO.Compression.FileSystem.dll Main.cs

  • Thanks for the response! After messing around with this for a long time I eventually ended up using the same solution you provided, I just forgot to update this post! I dont know who downvoted this, because it is the correct solution. – Leathel Feb 06 '18 at 19:26