mparlak / Flee

Fast Lightweight Expression Evaluator
624 stars 119 forks source link

System.PlatformNotSupportedException in .Net Standard 2.0 #87

Open andeq opened 3 years ago

andeq commented 3 years ago

We are currently developing a UWP App which should use Flee for Expression Evaluation. Unfortunately in the Release Build we get a System.PlatformNotSupportedException.

System.PlatformNotSupportedException: 'Dynamic code generation is not supported on this platform.'

at System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Reflection\Emit\ReflectionEmitThrower.cs:line 11 at Flee.InternalTypes.Expression1.CreateDynamicMethod() at Flee.InternalTypes.Expression1.Compile(String expression, ExpressionOptions options) at Flee.InternalTypes.Expression1..ctor(String expression, ExpressionContext context, Boolean isGeneric)`

Flee should support .Net Standard 2.0, but apparently DynamicMethod isn`t supported in .Net Standard 2.0: DynamicMethod Class

How can this be possible? How can we use Flee with .Net Standard 2.0 and UWP?

jl0pd commented 3 years ago

Library need to use multi-targeting and add net461, netcoreapp2.0, uap10.0 or maybe others to list of targets. Docs

hunkydoryrepair commented 3 years ago

Library need to use multi-targeting and add net461, netcoreapp2.0, uap10.0 or maybe others to list of targets. Docs

How would this resolve the issue of UWP not supporting dynamic code generation? Cannot use Reflection.Emit, which is pretty much all Flee does. It generates dynamic code.