TypeInitializationException, The path is not of a legal form

-1

I'm trying to make my binary more portable by adding my references as Embedded Resources. It consists of SevenZipSharp and DotNetZip (I'm switching entirely to SevenZipSharp to support Deflate64 compression method). Both are "merged" into the binary the same way (using System.Reflection). This guy is attempting to do the same thing, but is getting the same exception: issue with reference to .dll. (This is not a duplicate. He is asking a different question and solved it, but he encountered the same issue as I have.)

The error occurs when I'm calling the SevenZipBase.SetLibraryPath function.

System.TypeInitializationException
  HResult=0x80131534
  Message=The type initializer for 'SevenZip.SevenZipLibraryManager' threw an exception.
  Source=SevenZipSharp
  StackTrace:
   at SevenZip.SevenZipLibraryManager.SetLibraryPath(String libraryPath)
   at SevenZip.SevenZipBase.SetLibraryPath(String libraryPath)
   at ZibomodInstaller.InstallActions.InitConfig() in F:\source\Repos\ZibomodInstaller\ZibomodInstaller\InstallActions.cs:line 92
   at ZibomodInstaller.MainForm..ctor() in F:\source\Repos\ZibomodInstaller\ZibomodInstaller\MainForm.cs:line 24
   at ZibomodInstaller.Program.Main() in F:\source\Repos\ZibomodInstaller\ZibomodInstaller\Program.cs:line 26

Inner Exception 1:
ArgumentException: The path is not of a legal form.

Do note that DotNetZip works completely fine. This error occurs only when calling a function from SevenZipSharp.

c#
sevenzipsharp
typeinitializeexception
asked on Stack Overflow Jun 22, 2018 by henrikx

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0