Can't create a compressstram

Sep 14 at 2:52 PM
Edited Sep 14 at 2:53 PM
I try to create a compress stream.
If I call the CompressStream function I get the an excpetion in the IntEventArgsHandler event in ArchiveUpdateCallback.cs.

I try it with .NET 2.0 and .NET 4.5 in the SevenZipTest-Project. I change the CPU on x86.

         SevenZipCompressor.SetLibraryPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "7z.dll"));
         FileStream fsIn = File.OpenRead(@"D:\test.txt");
         MemoryStream msOut = new MemoryStream();

         SevenZip.SevenZipCompressor compressor = new SevenZip.SevenZipCompressor();
         compressor.DefaultItemName = "hallo";
         compressor.CompressionMethod = SevenZip.CompressionMethod.Lzma2;
         compressor.CompressionLevel = SevenZip.CompressionLevel.Normal;
         compressor.CompressStream(fsIn, msOut);
What am I doing wrong?

Thanks and regards