'GZipStream' could not be found - reference issue

左心房为你撑大大i 提交于 2020-01-25 13:03:47

问题


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?


回答1:


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

MSDN: GZipStream Class




回答2:


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



来源:https://stackoverflow.com/questions/21042535/gzipstream-could-not-be-found-reference-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!