System.IO.Compression.FileSystem.dll in c# program - c#

I' like to use the dll System.IO.Compression.FileSystem.dll in my project
the .net framework version is 4.5 and the os is 64. The problem is that the dll is not found.
What is the solution?

The namespace is not the same as the dll name (assembly name). from the MSDN page you linked
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. Take off the FileSystem part from your using statement and it will solve your problem.
If people are down-voting me because the OP said "The problem is that the dll is not found." I think the OP is not using the correct word choice, if the problem really was that the DLL could not be found there would be a exclamation point by the assembly name which the original screenshot does not have
See the original image below
(click for larger view)
Compare that to my screenshot I created that would show up if the DLL really was not found, note the exclamation point I have that the original screenshot does not.

in the System.IO.Compression there's no such class as FileSystem check it out the link on the msdn
the classes available are:
DeflateStream Provides methods and properties for compressing and decompressing streams by using the Deflate algorithm.
GZipStream Provides methods and properties used to compress and decompress streams.
ZipArchive Represents a package of compressed files in the zip archive format.
ZipArchiveEntry Represents a compressed file within a zip archive.
ZipFile Provides static methods for creating, extracting, and opening zip archives.
ZipFileExtensions
if your goal is to use compression of file or stream use the GZipStream class.
However remove the FileSystem from the using statement:
using System.IO.Compression;
Anyway as Joe Enos has pointed out classes from the Compression namespace have been taken out the Client Profile from the framework 4.5
Below the Version Information from the msdn about the GZipStream:
.NET Framework
Supported in: 4.5, 4, 3.5, 3.0, 2.0
.NET Framework Client Profile
Supported in: 4, 3.5 SP1

A new nuget package is coming out. Check this out :)
https://www.nuget.org/packages/System.IO.Compression.ZipFile

Adding reference to System.IO.Compression.dll solved this issue for me.

Related

System.Media.Soundplayer not a namespace? (mac)

I'm trying to play sounds in c#, and none of the System.Media namespaces are working, instead giving the error:
Error CS1069: The type name 'SoundPlayer' could not be found in the namespace 'System.Media'
I'm am doing using System.Media; but it still gives the error.
The SoundPlayer class provides a simple interface for loading and playing a .wav file. The SoundPlayer class supports loading a .wav file from a file path, a URL, a Stream that contains a .wav file, or an embedded resource that contains a .wav file.
It is for .Net Framework and not for .Net Core. Essentially, all of the sound-playing functionality that was available in .NET Framework was Windows-specific; therefore none of it made it into .NET Core.
For more information you can check SoundPlayer Class in Microsoft .Net Framework documentation.

How to use ImageIO plugins with a jar converted to dll using IKVM?

I am using Apache Tika in .Net by converting the jar to a dll with IKVM, and running into a problem parsing images out of PDF files. Closer inspection shows this is due to some methods not being implemented in JPEGImageReader.java in the openjdk source in IKVM.
Long story short, I am looking at the TwelveMonkeys ImageIO plugin to try and work around this. However, I do not really understand how I can add this plugin when using Tika with IKVM. As I understand it, as long as the ImageIO plugins are on the class path, they should be discovered automatically.
I have tried creating a dll for Tika with the TwelveMonkeys jars as dependencies:
ikvmc.exe -target:library -version:1.15 tika-app-1.15.jar common-image-3.3.2.jar common-io-3.3.2.jar common-lang-3.3.2.jar imageio-c
ore-3.3.2.jar imageio-metadata-3.3.2.jar imageio-jpeg-3.3.2.jar imageio-tiff-3.3.2.jar
When running Tika though, this does not use the TwelveMonkeys plugins.
What's the correct way to do this?

Namespace NPOI.POIFS.Crypt

I installed NPOI from NuGet, version 2.1.3. I want to read encrypted excel file. By this goal according to this thread i need use class EncryptionInfo from namespace NPOI.POIFS.Crypt. But my assembly not contain this namespace.
If you look at the GitHub repository for this library, you will see this namespace in version 2.1.3.
What is my error?
P.S. Sorry for my english language

What is cvtres.exe?

When I'm using aspnet_compiler.exe to pre-compile my website, I see a cvtres.exe process along with csc.exe. I'm assuming this is part of the .NET compilation process, and would also show when compiling my .NET assemblies. What is cvtres.exe and what does it do?
Windows Resource to Object Converter (CvtRes.exe) (from here)
As to what it does, well... I guess that it converts Resources to Objects.
Edit: As Scott says,
to be more specific, it is part of the C++ toolchain to turn resource
files (.res) in to compiled objects that can be linked using the
linker.
I was looking for something official that explains it, but the best I could find is an old support article that mentions it. Hope it helps!

Decompile .pdb file C# (Program database)

I want to decompile .pdb files so I can see where references are pointing to. The projects are being built from a build server. I also want to explore the possibility of using these to index a codebase.
I cannot seem to find any tools to decompile and view the contents.
I have found this stack post Help me to read .pdb file but the first recommended example is missing (Producing an XML would be ideal) && the second will not build on my machine.
I have also tried using reflector to open the file but does not work.
Can anyone provide insight into how I can deompile a .pdb file?
You can try using Mono.Cecil project. It's open source libraries for decompiling .NET assemblies to IL code. It also allow to work with .pdb files of .NET projects. Mono.Cecil doesn't use reflection, it reads assembly as byte stream.
For decompiling assembly to C# code, you can look to the ILSpy project. It's also open source project and it uses the Mono.Cecil library inside.

Categories

Resources