deniszykov / csharp-eval-unity3d

C# Expression Parser for Unity3D
Other
203 stars 25 forks source link

Exception #3

Open yanmasharski opened 6 years ago

yanmasharski commented 6 years ago

Catched exception on the first call CSharpExpression.Evaluate

NotSupportedException: /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Reflection.Emit/DynamicMethod.cpp(24) : Unsupported internal call for IL2CPP:DynamicMethod::destroy_dynamic_method - System.Reflection.Emit is not supported.

deniszykov commented 6 years ago

Hi @yanmasharski! 1) On which platform? 2) How is library embedded in Unity's build. Source or dll? 3) Which version of c# eval is used?

yanmasharski commented 6 years ago
  1. iOS
  2. DLL from AssetStore
  3. v2.2.1
deniszykov commented 6 years ago

destroy_dynamic_method -it's looks like DynamicMethod's de-constructor. I use this code https://github.com/deniszykov/csharp-eval-unity3d/blob/c99130db7d69159cc94382b3e864bc62c74a099a/GameDevWare.Dynamic.Expressions/AotCompilation.cs#L41 to detect AOT runtime. It's create an instance of DynamicMethod via call to Expression<T>.Compile(). And later this instance cause exception in Finalizer thread because DynamicMethod.Finalize() is not implemented in IL2CPP runtime.

You actually can't catch this exception because it's raised in Finalizer thread and just logged.

Are you sure that you caught this exception or it's just appear in log?

p.s. i reported this bug to Unity long time ago.

yanmasharski commented 6 years ago

I found this exception in the log. Thanks for you answer.