4

In July 2017 WinRar released version 5.5 which made changes to the rar standard. Since then, our library of choice, SharpCompress, fails with any archives produced by that version:

System.InvalidOperationException: Cannot determine compressed stream type. Supported Archive Formats: Zip, GZip, Tar, Rar, 7Zip
  at SharpCompress.Archive.ArchiveFactory.Open (System.IO.Stream stream, SharpCompress.Common.Options options) [0x00104] in <c75ca43fe8b84e939decf36d5e9b045b>:0
  at ImporterProject.Program+<ImportDemo>c__async1.MoveNext () [0x005d9] in <131bee082c1a48da8a91db5359e262cc>:0

An example of a new archive can be downloaded here. 7zip opens this file without probelms, which is why I know that the archive is not broken.

What other libraries are there that support reading of rar-archives in .NET? Optimally, the library should work on mono/FreeBSD in addition to Windows.

Flai
  • 160
  • 1
  • 8
  • I have developed something that works for our usecase, but isn't that great in general: https://gist.github.com/moritzuehling/fb371e20d93569271481a9a4f74a024b It requires unrar (on linux/bsd) or 7zip (on windows) to be installed. – Flai Apr 11 '18 at 09:35
  • __win.rar GmbH__ releases not only the __WinRAR__ package, but also the free to use library `UnRAR.dll` and even the free to use `UnRAR` source code at [RARLAB - Extras](https://www.rarlab.com/rar_add.htm). The documentation of the archive file format is also available for download by every developer who wants to extract RAR archives of any format with a self-made application. – Mofi Dec 24 '19 at 15:12

0 Answers0