mbraceproject / FsPickler

A fast multi-format message serializer for .NET
http://mbraceproject.github.io/FsPickler/
MIT License
323 stars 54 forks source link

Support for blazor #116

Closed OnurGumus closed 4 years ago

OnurGumus commented 4 years ago

When I use fspickler to serialize a quotation in Blazor/Web Assembly I am getting the below error:

ASM: Exception:MBrace.FsPickler.PicklerGenerationException: Error generating pickler for type 'Microsoft.FSharp.Reflection.UnionCaseInfo'. ---> System.PlatformNotSupportedException: System.Reflection.Emit.Lightweight is not supported on this platform.
blazor.webassembly.js:1 WASM:   at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes, System.Type owner, System.Boolean skipVisibility) <0x43b1198 + 0x0002c> in <b3d13424cc744829bed0020ff9860ba1>:0 
blazor.webassembly.js:1 WASM:   at MBrace.FsPickler.Emit+DynamicMethod.compile@71[Delegate] (System.String name, System.Type[] argTypes, System.Type returnType, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] ilBuilder, Microsoft.FSharp.Core.Unit unitVar0) <0x43b1010 + 0x0001a> in <5d0bb979a7100485a745038379b90b5d>:0 
eiriktsarpalis commented 4 years ago

This library is not designed for use in non-CLR runtimes.