'GZipStream' could not be found - reference issue

1.9k Views Asked by At

I can't get to use GZipStream class in my C# ASP.NET 4.5 application.

I get the error:

The type or namespace name 'GZipStream' could not be found (are you missing a using directive or an assembly reference?)

I tried using using System.IO; but the System.IO.Compression is not available in the "Reference Manager" in visual studio. I right click on the object name to see if Visual Studio finds the relevant reference but it does not.

Any suggestions?

2

There are 2 best solutions below

1
On BEST ANSWER

Need to add reference to System.dll assembly and using System.IO.Compression namespace.

MSDN: GZipStream Class

1
On

The namespace is not the same as the dll name,You need to add a dll reference to the assembly, System.IO.Compression.FileSystem.dll