csharp-eval-unity3d icon indicating copy to clipboard operation
csharp-eval-unity3d copied to clipboard

Exception

Open yanmasharski opened this issue 6 years ago • 4 comments

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.

yanmasharski avatar Mar 13 '18 16:03 yanmasharski

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?

deniszykov avatar Mar 13 '18 17:03 deniszykov

  1. iOS
  2. DLL from AssetStore
  3. v2.2.1

yanmasharski avatar Mar 14 '18 10:03 yanmasharski

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.

deniszykov avatar Mar 14 '18 20:03 deniszykov

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

yanmasharski avatar Mar 15 '18 14:03 yanmasharski