This project is read-only.
2
Vote

Exception with mono

description

Hello,

I got these exception running my application on mono (on Framework .Net it works fine)
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for LZ4.LZ4Codec ---> System.NotSupportedException: No LZ4 compression service found
at LZ4.LZ4Codec..cctor () [0x00000] in <filename unknown>:0

Do you have any idea ?

comments

Krashan wrote Mar 24, 2015 at 2:12 PM

I believe I have. On startup it tries to find out which encoder/decoder can be used mixed mode/unsafe/safe. Testing availability of mixed mode involves reading registry key (to find VC++2010 Runtime).
I understand you don't have registry access on mono.

I will wrap testing from registry in try ... except, but for now you can take LZ4n or LZ4s assembly instead of "all-on-one".

facotl wrote Mar 24, 2015 at 5:31 PM

Hello,

Thank you for your response.
Actually I use nuget to import LZ4 in my project. Is there any way to force LZ4n or LZ4s with it ?

facotl wrote Mar 24, 2015 at 5:35 PM

At the end, my application will run on ARM target. Does LZ4n or LZ4s call x86 native code or it's clearly portable ?

Krashan wrote Apr 1, 2015 at 12:07 PM

Mono: I will make registry check safer so it will work on Mono without problems
ARM: It depends, that mey or mey not be a problem. LZ4 is algorithm tailored for little-endian architecture. From what I heard (don't quote me on that though) ARM is big-endian but blocks of code may be ran as little endian. But the safe answer is: I DON'T KNOW.

Krashan wrote Jul 29, 2015 at 10:06 PM

Addressed in 1.0.6.93 (see: https://github.com/MiloszKrajewski/lz4net)