2014-01-10 34 views
0

我無法在我的C#ASP.NET 4.5應用程序中使用GZipStream類。'GZipStream'找不到 - 參考問題

我得到的錯誤:

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

我試着用using System.IO;System.IO.Compression不可在Visual Studio中的「參考文獻管理器」。我右鍵單擊對象名稱以查看Visual Studio是否找到相關的引用,但它沒有。

有什麼建議嗎?

+1

這不是在'System.IO.Compression.dll'(它是ZIP檔案),'GZipStream'但在'System.dll'組裝。使用System.IO.Compression添加''。 –

+0

添加你的答案,我會接受 –

+1

你可以接受Ozik的答案,或多或少相同的內容。 –

回答

3

需要補充參考System.dll組裝和using System.IO.Compression命名空間。

MSDN:GZipStream Class

+0

對,但我想他已經有了System.dll的引用! :) –

0

命名空間是不一樣的DLL名稱,你需要一個DLL引用添加到組裝,System.IO.Compression.FileSystem.dll

+1

不,System.IO.Compression.FileSystem程序集是用於ZipFile而不是用於_simple_ gzip流(它只是在System.dll中) –