System.IO.Compression.FileSystem.dll in C # program

I like to use dll System.IO.Compression.FileSystem.dll in my project

file

the .net Framework version is 4.5, and os is 64. The problem is that the dll was not found. config What is the solution?

+4
source share
4 answers

The namespace does not match the dll name (assembly name). on the MSDN page you specified

Namespace : System.IO.Compression
Assembly : System.IO.Compression.FileSystem (in System.IO.Compression.FileSystem.dll)

So the namespace you need to include is System.IO.Compression not System.IO.Compression.FileSystem . Remove the FileSystem part from the using statement and it will solve your problem.


If people vote for me because the OP said: "The problem is that the DLL was not found." I think that OP does not use the correct word choice, if the problem is actually that the DLL cannot be found, there will be an exclamation mark by the name of the assembly in which the original screenshot does not have

See the original image below.

Original image
(click to enlarge)

Compare this to my screenshot that I created, which will be displayed if the DLL had not really been found, note the exclamation mark that I have that the original screenshot does not work.

enter image description here

+12
source

there is no class like FileSystem in System.IO.Compression, check the link to msdn

available classes:

  • DeflateStream Provides methods and properties for compressing and decompressing streams using the Deflate algorithm.
  • GZipStream Provides methods and properties used to compress and decompress streams.
  • ZipArchive Represents a package of compressed files in a zip archive format.
  • ZipArchiveEntry Represents a compressed file in a zip archive.
  • ZipFile Provides static methods for creating, extracting, and opening zip archives.
  • ZipFileExtensions

if your goal is to use file or stream compression, use the GZipStream class.

However, remove the FileSystem from the using statement:

 using System.IO.Compression; 

In any case, since Joe Enos specified classes from the compression namespace, the client profile was deduced from the 4.5 framework

Below is the version information from msdn about GZipStream:

.NET Framework Supported in versions: 4,5, 4, 3,5, 3,0, 2,0

.NET Framework Client Profile Supported in: 4, 3.5 SP1

+4
source

A new nuget package will appear. Check this:)

https://www.nuget.org/packages/System.IO.Compression.ZipFile

+1
source

Adding a link to System.IO.Compression.dll solved this problem for me.

-2
source

Source: https://habr.com/ru/post/1483826/


All Articles