Giter VIP home page Giter VIP logo

dotnow-interpreter's People

Contributors

lr-k avatar scottyboy805 avatar skutteoleg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotnow-interpreter's Issues

It is not possible to create a CLR Method Binding for generic methods

At the moment it is only possible to create interop method bindings for non-generic methods. Support should be added for generic methods as it will help to get around AOT issues where code was not generated like this:

[EXCEPTION] NotSupportedException: D:\Program Files\UnityEditors\2018.2.20f1\Editor\Data\il2cpp\libil2cpp\icalls\mscorlib\System.Runtime.CompilerServices\RuntimeHelpers.cpp(72) : Unsupported internal call for IL2CPP:RuntimeHelpers::GetObjectValue - "This icall is not supported by il2cpp."
>>>dotnow.Runtime.CIL.CILInterpreter.ExecuteInterpreted (dotnow.AppDomain domain, dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame& frame, dotnow.Runtime.CIL.CILOperation[]& instructions, dotnow.Reflection.CLRExceptionHandler[]& exceptionHandlers, DebugFlags debugFlags)
dotnow.Runtime.ExecutionEngine.Execute (dotnow.AppDomain domain, dotnow.Runtime.ExecutionFrame frame, dotnow.Runtime.CIL.CILOperation[] methodInstructions, dotnow.Reflection.CLRExceptionHandler[] exceptionHandlers, Int32 initialInstructionIndex, Boolean debuggerResume)
dotnow.Runtime.ExecutionMethod.ReflectionInvoke (System.Object obj, System.Object[] parameters)

Instantiating a GameObject with a MonoBehaviour attached causes exception

Given the existing code to load a MonoBehaviour and attach it to a GameObject

var gameObject = new GameObject("original");
AppDomain domain = new AppDomain();

// Load the module
CLRModule module = domain.LoadModuleStream(new MemoryStream(assemblyModule.bytes), false);

// Find the main type
Type mainType = module.GetTypes()
    .Where(t => t.IsSubclassOf(typeof(MonoBehaviour)))
    .FirstOrDefault();

// Add component - cannot use 'gameObject.AddComponent' because it would crash the engine.
MonoBehaviourProxy.AddComponentOverride(domain, null, gameObject, new object[] { mainType });

The following code, which is the mainType in the code above, does not work

using UnityEngine;

namespace InstantiateMonobehaviourTest
{
    public class TestCase : MonoBehaviour
    {
        public void Start()
        {
            Instantiate(gameObject);
        }
    }
}

One GameObject "original" will be created with the correct MonoBehaviour. Once Start() is called, an exception will occur

InvalidCastException on setting array value in interpreted code

public class MonoTest : MonoBehaviour
    {
        private void Start()
        {
            var array = new Test[10];

            for (int i = 0; i < array.Length; i++)
            {
                array[i] = new Test(1);
            }
        }
    }

    class Test
    {
        public int IntValue;

        public Test(int intValue)
        {
            IntValue = intValue;
        }
    }
At method body: System.Void Project_B_Library.MonoTest::Start()
0x00007ff67bac8bdc (Unity) StackWalker::GetCurrentCallstack
0x00007ff67bacffd9 (Unity) StackWalker::ShowCallstack
0x00007ff67c82cd9c (Unity) GetStacktrace
0x00007ff67d275e83 (Unity) DebugStringToFile
0x00007ff67bb802f6 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x000002463ccd8b2b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000002463ccd89cb (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000024635edf06e (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x00000247308ff8aa (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x0000024635efe6b3 (Mono JIT Code) [ExecutionEngine.cs:181] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x0000024635ef860b (Mono JIT Code) [CLRMethodBodyBase.cs:82] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x0000024635ef68eb (Mono JIT Code) [ExecutionMethod.cs:60] dotnow.Runtime.ExecutionMethod:ReflectionInvoke (object,object[]) 
0x00000247308f5523 (Mono JIT Code) [CLRMethod.cs:221] dotnow.Reflection.CLRMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) 
0x000002463cc8c80f (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
0x00000247308f4dab (Mono JIT Code) [MonoBehaviourProxy.cs:89] UnityEngine.MonoBehaviourProxy:Start () 
0x0000024635eea268 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe48d5f1e0 (mono-2.0-bdwgc) [mini-runtime.c:2849] mono_jit_runtime_invoke 
0x00007ffe48ce2ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
0x00007ffe48cebb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
0x00007ff67ba0cd34 (Unity) scripting_method_invoke
0x00007ff67ba08011 (Unity) ScriptingInvocation::Invoke
0x00007ff67b9dbfad (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff67b9dc0d8 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff67b9d6ce2 (Unity) MonoBehaviour::DelayedStartCall
0x00007ff67b54bfa4 (Unity) DelayedCallManager::Update
0x00007ff67b744099 (Unity) `InitPlayerLoopCallbacks'::`2'::EarlyUpdateScriptRunDelayedStartupFrameRegistrator::Forward
0x00007ff67b72c4dc (Unity) ExecutePlayerLoop
0x00007ff67b72c5b3 (Unity) ExecutePlayerLoop
0x00007ff67b733059 (Unity) PlayerLoop
0x00007ff67c3efa91 (Unity) PlayerLoopController::UpdateScene
0x00007ff67c3dbcef (Unity) PlayerLoopController::EnterPlayMode
0x00007ff67c3eb11d (Unity) PlayerLoopController::SetIsPlaying
0x00007ff67c3edf87 (Unity) Application::TickTimer
0x00007ff67c8334d1 (Unity) MainMessageLoop
0x00007ff67c837521 (Unity) WinMain
0x00007ff67dec5752 (Unity) __scrt_common_main_seh
0x00007ffeabd67034 (KERNEL32) BaseThreadInitThunk
0x00007ffeac222651 (ntdll) RtlUserThreadStart

At instruction: Ldc_I4_S
0x00007ff67bac8bdc (Unity) StackWalker::GetCurrentCallstack
0x00007ff67bacffd9 (Unity) StackWalker::ShowCallstack
0x00007ff67c82cd9c (Unity) GetStacktrace
0x00007ff67d275e83 (Unity) DebugStringToFile
0x00007ff67bb802f6 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x000002463ccd8b2b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000002463ccd89cb (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000024635edf06e (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x00000247308ff8aa (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x0000024635efe7db (Mono JIT Code) [ExecutionEngine.cs:182] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x0000024635ef860b (Mono JIT Code) [CLRMethodBodyBase.cs:82] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x0000024635ef68eb (Mono JIT Code) [ExecutionMethod.cs:60] dotnow.Runtime.ExecutionMethod:ReflectionInvoke (object,object[]) 
0x00000247308f5523 (Mono JIT Code) [CLRMethod.cs:221] dotnow.Reflection.CLRMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) 
0x000002463cc8c80f (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
0x00000247308f4dab (Mono JIT Code) [MonoBehaviourProxy.cs:89] UnityEngine.MonoBehaviourProxy:Start () 
0x0000024635eea268 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe48d5f1e0 (mono-2.0-bdwgc) [mini-runtime.c:2849] mono_jit_runtime_invoke 
0x00007ffe48ce2ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
0x00007ffe48cebb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
0x00007ff67ba0cd34 (Unity) scripting_method_invoke
0x00007ff67ba08011 (Unity) ScriptingInvocation::Invoke
0x00007ff67b9dbfad (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff67b9dc0d8 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff67b9d6ce2 (Unity) MonoBehaviour::DelayedStartCall
0x00007ff67b54bfa4 (Unity) DelayedCallManager::Update
0x00007ff67b744099 (Unity) `InitPlayerLoopCallbacks'::`2'::EarlyUpdateScriptRunDelayedStartupFrameRegistrator::Forward
0x00007ff67b72c4dc (Unity) ExecutePlayerLoop
0x00007ff67b72c5b3 (Unity) ExecutePlayerLoop
0x00007ff67b733059 (Unity) PlayerLoop
0x00007ff67c3efa91 (Unity) PlayerLoopController::UpdateScene
0x00007ff67c3dbcef (Unity) PlayerLoopController::EnterPlayMode
0x00007ff67c3eb11d (Unity) PlayerLoopController::SetIsPlaying
0x00007ff67c3edf87 (Unity) Application::TickTimer
0x00007ff67c8334d1 (Unity) MainMessageLoop
0x00007ff67c837521 (Unity) WinMain
0x00007ff67dec5752 (Unity) __scrt_common_main_seh
0x00007ffeabd67034 (KERNEL32) BaseThreadInitThunk
0x00007ffeac222651 (ntdll) RtlUserThreadStart

InvalidCastException
System.Array.SetValue (System.Object value, System.Int32 index) (at <695d1cc93cca45069c528c15c9fdd749>:0)
dotnow.Runtime.CIL.CILInterpreter.ExecuteInterpreted (dotnow.AppDomain domain, dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame& frame, dotnow.Runtime.CIL.CILOperation[]& instructions, dotnow.Reflection.CLRExceptionHandler[]& exceptionHandlers, dotnow.Runtime.ExecutionEngine+DebugFlags& debugFlags) (at Scripts/Runtime/CIL/CILInterpreter.cs:2224)
dotnow.Runtime.ExecutionEngine.Execute (dotnow.AppDomain domain, dotnow.Runtime.ExecutionFrame frame, dotnow.Runtime.CIL.CILOperation[] methodInstructions, dotnow.Reflection.CLRExceptionHandler[] exceptionHandlers, System.Int32 initialInstructionIndex, System.Boolean debuggerResume) (at Scripts/Runtime/ExecutionEngine.cs:188)
dotnow.Reflection.CLRMethodBodyBase.ExecuteMethodBody (dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame frame) (at Scripts/Runtime/Reflection/CLRMethodBodyBase.cs:82)
dotnow.Runtime.ExecutionMethod.ReflectionInvoke (System.Object obj, System.Object[] parameters) (at Scripts/Runtime/ExecutionMethod.cs:60)
dotnow.Reflection.CLRMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at Scripts/Runtime/Reflection/CLRMethod.cs:221)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <695d1cc93cca45069c528c15c9fdd749>:0)
UnityEngine.MonoBehaviourProxy.Start () (at Scripts/Runtime/Integration/Unity/MonoBehaviourProxy.cs:89)

are there any other ways to create a data structure?

StackData struct should not store a managed object reference

The current StackData structure stores an 'object' field for references to heap objects needed by some instructions. In order to support unsafe code in the future, this should be removed and a replacement found. The stack data should simply store the object address as an integer which will allow the StackData type to be used in an unsafe context. This will require many changes to the code base and a suitable system for tracking managed objects by address will need to be implemented. The current ByRef implementation may also need to change or be redesigned to support this.

Coroutines not supported

The following coroutine code causes stack corruption and unexpected behavior:

using UnityEngine;
using System.Collections;

public class CoroutineTest : MonoBehaviour {

private void Start()
{        
    StartCoroutine(Coroutine());
}

private IEnumerator Coroutine()
{
    var time = Time.unscaledTime;
    yield return new WaitForSecondsRealtime(5f);

    //Delay time is wrong
    Debug.Log(Time.unscaledTime - time);

    //Delay time is close to frame time
    Debug.Log(Time.unscaledDeltaTime);

    //This throws an error
    transform.position = Vector3.zero;
}

}

Interpreted value types are treated as reference types

Value types defined inside an assembly that is loaded for interpretation will be passed by reference and allocated on the heap. They should be stack allocated and copied to replicate the correct behavior of the runtime (Interop value types work correctly). Work is needed in CLRInstance to support this.

Custom attributes on runtime scripts are not stored/retrievable

Runtime scripts do not seem to transpose/store custom attribute information to CLRFields.

e.g. a runtime script with [MyCustomAttribute] private SomeClass _field;
cannot later retrieve the attribute, for example via:
var attr = clrField.GetCustomAttributes(typeof(MyCustomAttribute));

Unity Vector3 not able to assign value to field.

https://prnt.sc/1xahlny

ArgumentException: Field x defined on type UnityEngine.Vector3 is not a field on the target object which is of type dotnow.Runtime.ByRefVariable.


I did this and it seems to have fixed the issue:

case Code.Stfld:
{
    fieldAccess = (CILFieldAccess)instruction.objectOperand;

    // Check for direct access deleate
    if(fieldAccess.directWriteAccessDelegate != null)
    {
        fieldAccess.directWriteAccessDelegate(stack, stackPtr - 2);
        break;
    }

    right = stack[--stackPtr];      // val
    temp = stack[--stackPtr];       // inst

    var unboxedValue = right.UnboxAsType(fieldAccess.fieldTypeInfo);
    var box = temp.Box();

    if (box is ByRefVariable)
        fieldAccess.targetField.SetValue(((ByRefVariable)box).GetReferenceValue().refValue, unboxedValue);
    else fieldAccess.targetField.SetValue(box, unboxedValue);

    break;
}

Using outside of Unity?

Edit: I forgot the description says it's pure C# project, which answers the first part of the question

Hi, does this project use any Unity-specific code, or can it be used in any C# project?

And if yes, can I use it with C# to native compiler other than IL2CPP, like Brute (similar to IL2CPP, used by MonoGame to compile C# to C++ for consoles) or NativeAOT? (the new, official Microsoft's IL to native code compiler)
(This article explains the current situation with C# to native code compilation)

Creating instance of class and assignment value of non CLR class occurs exception

if in interpreted method contain a creating new instance of any class then every non interpreted MonoBehaviour counts as null in this method

private void Start()
{
      Ptr();
}

private void Ptr()
{
      _info = new CusomInfo();
      TMP_TextTest.text = _info.NameKey; //exception
}
private void Start()
{
      _info = new CusomInfo();
      Ptr();
}

private void Ptr()
{
      TMP_TextTest.text = _info.NameKey; //work fine
}
At method body: System.Void Project_B_Library.MonoTest::P()
0x00007ff67bac8bdc (Unity) StackWalker::GetCurrentCallstack
0x00007ff67bacffd9 (Unity) StackWalker::ShowCallstack
0x00007ff67c82cd9c (Unity) GetStacktrace
0x00007ff67d275e83 (Unity) DebugStringToFile
0x00007ff67bb802f6 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x000001e44932d37b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000001e44932cf9b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x000001e52b01c67e (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000001e491e37fba (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x000001e52b0deac3 (Mono JIT Code) [ExecutionEngine.cs:181] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x000001e52b0d81ab (Mono JIT Code) [CLRMethodBodyBase.cs:82] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x000001e526abbb7b (Mono JIT Code) [CILInterpreter.cs:2557] dotnow.Runtime.CIL.CILInterpreter:ExecuteInterpreted (dotnow.AppDomain,dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame&,dotnow.Runtime.CIL.CILOperation[]&,dotnow.Reflection.CLRExceptionHandler[]&,dotnow.Runtime.ExecutionEngine/DebugFlags&) 
0x000001e52b0de8cb (Mono JIT Code) [ExecutionEngine.cs:175] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x000001e52b0d81ab (Mono JIT Code) [CLRMethodBodyBase.cs:82] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x000001e52b0d62fb (Mono JIT Code) [ExecutionMethod.cs:60] dotnow.Runtime.ExecutionMethod:ReflectionInvoke (object,object[]) 
0x000001e491e2d9c3 (Mono JIT Code) [CLRMethod.cs:221] dotnow.Reflection.CLRMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) 
0x000001e449306d0f (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
0x000001e491e2d26b (Mono JIT Code) [MonoBehaviourProxy.cs:89] UnityEngine.MonoBehaviourProxy:Start () 
0x000001e52b0c9118 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe62fef1e0 (mono-2.0-bdwgc) [mini-runtime.c:2849] mono_jit_runtime_invoke 
0x00007ffe62f72ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
0x00007ffe62f7bb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
0x00007ff67ba0cd34 (Unity) scripting_method_invoke
0x00007ff67ba08011 (Unity) ScriptingInvocation::Invoke
0x00007ff67b9dbfad (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff67b9dc0d8 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff67b9d6ce2 (Unity) MonoBehaviour::DelayedStartCall
0x00007ff67b54bfa4 (Unity) DelayedCallManager::Update
0x00007ff67b744099 (Unity) `InitPlayerLoopCallbacks'::`2'::EarlyUpdateScriptRunDelayedStartupFrameRegistrator::Forward
0x00007ff67b72c4dc (Unity) ExecutePlayerLoop
0x00007ff67b72c5b3 (Unity) ExecutePlayerLoop
0x00007ff67b733059 (Unity) PlayerLoop
0x00007ff67c3efa91 (Unity) PlayerLoopController::UpdateScene
0x00007ff67c3dbcef (Unity) PlayerLoopController::EnterPlayMode
0x00007ff67c3eb11d (Unity) PlayerLoopController::SetIsPlaying
0x00007ff67c3edf87 (Unity) Application::TickTimer
0x00007ff67c8334d1 (Unity) MainMessageLoop
0x00007ff67c837521 (Unity) WinMain
0x00007ff67dec5752 (Unity) __scrt_common_main_seh
0x00007ffeabd67034 (KERNEL32) BaseThreadInitThunk
0x00007ffeac222651 (ntdll) RtlUserThreadStart

At method body: System.Void Project_B_Library.MonoTest::Start()
0x00007ff67bac8bdc (Unity) StackWalker::GetCurrentCallstack
0x00007ff67bacffd9 (Unity) StackWalker::ShowCallstack
0x00007ff67c82cd9c (Unity) GetStacktrace
0x00007ff67d275e83 (Unity) DebugStringToFile
0x00007ff67bb802f6 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x000001e44932d37b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000001e44932cf9b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x000001e52b01c67e (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000001e491e37fba (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x000001e52b0deac3 (Mono JIT Code) [ExecutionEngine.cs:181] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x000001e52b0d81ab (Mono JIT Code) [CLRMethodBodyBase.cs:82] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x000001e52b0d62fb (Mono JIT Code) [ExecutionMethod.cs:60] dotnow.Runtime.ExecutionMethod:ReflectionInvoke (object,object[]) 
0x000001e491e2d9c3 (Mono JIT Code) [CLRMethod.cs:221] dotnow.Reflection.CLRMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) 
0x000001e449306d0f (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
0x000001e491e2d26b (Mono JIT Code) [MonoBehaviourProxy.cs:89] UnityEngine.MonoBehaviourProxy:Start () 
0x000001e52b0c9118 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe62fef1e0 (mono-2.0-bdwgc) [mini-runtime.c:2849] mono_jit_runtime_invoke 
0x00007ffe62f72ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
0x00007ffe62f7bb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
0x00007ff67ba0cd34 (Unity) scripting_method_invoke
0x00007ff67ba08011 (Unity) ScriptingInvocation::Invoke
0x00007ff67b9dbfad (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff67b9dc0d8 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff67b9d6ce2 (Unity) MonoBehaviour::DelayedStartCall
0x00007ff67b54bfa4 (Unity) DelayedCallManager::Update
0x00007ff67b744099 (Unity) `InitPlayerLoopCallbacks'::`2'::EarlyUpdateScriptRunDelayedStartupFrameRegistrator::Forward
0x00007ff67b72c4dc (Unity) ExecutePlayerLoop
0x00007ff67b72c5b3 (Unity) ExecutePlayerLoop
0x00007ff67b733059 (Unity) PlayerLoop
0x00007ff67c3efa91 (Unity) PlayerLoopController::UpdateScene
0x00007ff67c3dbcef (Unity) PlayerLoopController::EnterPlayMode
0x00007ff67c3eb11d (Unity) PlayerLoopController::SetIsPlaying
0x00007ff67c3edf87 (Unity) Application::TickTimer
0x00007ff67c8334d1 (Unity) MainMessageLoop
0x00007ff67c837521 (Unity) WinMain
0x00007ff67dec5752 (Unity) __scrt_common_main_seh
0x00007ffeabd67034 (KERNEL32) BaseThreadInitThunk
0x00007ffeac222651 (ntdll) RtlUserThreadStart


At instruction: Ldarg_0
0x00007ff67bac8bdc (Unity) StackWalker::GetCurrentCallstack
0x00007ff67bacffd9 (Unity) StackWalker::ShowCallstack
0x00007ff67c82cd9c (Unity) GetStacktrace
0x00007ff67d275e83 (Unity) DebugStringToFile
0x00007ff67bb802f6 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x000001e44932d37b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000001e44932cf9b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x000001e52b01c67e (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000001e491e37fba (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x000001e52b0debeb (Mono JIT Code) [ExecutionEngine.cs:182] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x000001e52b0d81ab (Mono JIT Code) [CLRMethodBodyBase.cs:82] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x000001e52b0d62fb (Mono JIT Code) [ExecutionMethod.cs:60] dotnow.Runtime.ExecutionMethod:ReflectionInvoke (object,object[]) 
0x000001e491e2d9c3 (Mono JIT Code) [CLRMethod.cs:221] dotnow.Reflection.CLRMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) 
0x000001e449306d0f (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
0x000001e491e2d26b (Mono JIT Code) [MonoBehaviourProxy.cs:89] UnityEngine.MonoBehaviourProxy:Start () 
0x000001e52b0c9118 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe62fef1e0 (mono-2.0-bdwgc) [mini-runtime.c:2849] mono_jit_runtime_invoke 
0x00007ffe62f72ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
0x00007ffe62f7bb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
0x00007ff67ba0cd34 (Unity) scripting_method_invoke
0x00007ff67ba08011 (Unity) ScriptingInvocation::Invoke
0x00007ff67b9dbfad (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff67b9dc0d8 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff67b9d6ce2 (Unity) MonoBehaviour::DelayedStartCall
0x00007ff67b54bfa4 (Unity) DelayedCallManager::Update
0x00007ff67b744099 (Unity) `InitPlayerLoopCallbacks'::`2'::EarlyUpdateScriptRunDelayedStartupFrameRegistrator::Forward
0x00007ff67b72c4dc (Unity) ExecutePlayerLoop
0x00007ff67b72c5b3 (Unity) ExecutePlayerLoop
0x00007ff67b733059 (Unity) PlayerLoop
0x00007ff67c3efa91 (Unity) PlayerLoopController::UpdateScene
0x00007ff67c3dbcef (Unity) PlayerLoopController::EnterPlayMode
0x00007ff67c3eb11d (Unity) PlayerLoopController::SetIsPlaying
0x00007ff67c3edf87 (Unity) Application::TickTimer
0x00007ff67c8334d1 (Unity) MainMessageLoop
0x00007ff67c837521 (Unity) WinMain
0x00007ff67dec5752 (Unity) __scrt_common_main_seh
0x00007ffeabd67034 (KERNEL32) BaseThreadInitThunk
0x00007ffeac222651 (ntdll) RtlUserThreadStart


nvalidOperationException: Cannot assign field value for non CLR instance
dotnow.Reflection.CLRField.SetValue (System.Object obj, System.Object value, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) (at Assets/Scripts/Runtime/Reflection/CLRField.cs:153)
System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) (at <695d1cc93cca45069c528c15c9fdd749>:0)
dotnow.Runtime.CIL.CILInterpreter.ExecuteInterpreted (dotnow.AppDomain domain, dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame& frame, dotnow.Runtime.CIL.CILOperation[]& instructions, dotnow.Reflection.CLRExceptionHandler[]& exceptionHandlers, dotnow.Runtime.ExecutionEngine+DebugFlags& debugFlags) (at Assets/Scripts/Runtime/CIL/CILInterpreter.cs:2332)
dotnow.Runtime.ExecutionEngine.Execute (dotnow.AppDomain domain, dotnow.Runtime.ExecutionFrame frame, dotnow.Runtime.CIL.CILOperation[] methodInstructions, dotnow.Reflection.CLRExceptionHandler[] exceptionHandlers, System.Int32 initialInstructionIndex, System.Boolean debuggerResume) (at Assets/Scripts/Runtime/ExecutionEngine.cs:188)
dotnow.Reflection.CLRMethodBodyBase.ExecuteMethodBody (dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame frame) (at Assets/Scripts/Runtime/Reflection/CLRMethodBodyBase.cs:82)
dotnow.Runtime.CIL.CILInterpreter.ExecuteInterpreted (dotnow.AppDomain domain, dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame& frame, dotnow.Runtime.CIL.CILOperation[]& instructions, dotnow.Reflection.CLRExceptionHandler[]& exceptionHandlers, dotnow.Runtime.ExecutionEngine+DebugFlags& debugFlags) (at Assets/Scripts/Runtime/CIL/CILInterpreter.cs:2557)
dotnow.Runtime.ExecutionEngine.Execute (dotnow.AppDomain domain, dotnow.Runtime.ExecutionFrame frame, dotnow.Runtime.CIL.CILOperation[] methodInstructions, dotnow.Reflection.CLRExceptionHandler[] exceptionHandlers, System.Int32 initialInstructionIndex, System.Boolean debuggerResume) (at Assets/Scripts/Runtime/ExecutionEngine.cs:188)
dotnow.Reflection.CLRMethodBodyBase.ExecuteMethodBody (dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame frame) (at Assets/Scripts/Runtime/Reflection/CLRMethodBodyBase.cs:82)
dotnow.Runtime.ExecutionMethod.ReflectionInvoke (System.Object obj, System.Object[] parameters) (at Assets/Scripts/Runtime/ExecutionMethod.cs:60)
dotnow.Reflection.CLRMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at Assets/Scripts/Runtime/Reflection/CLRMethod.cs:221)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <695d1cc93cca45069c528c15c9fdd749>:0)
UnityEngine.MonoBehaviourProxy.Start () (at Assets/Scripts/Runtime/Integration/Unity/MonoBehaviourProxy.cs:89)

Roslyn C# integration and interfaces

The following will always return null for interfaces:

ScriptType type = assembly.FindSubTypeOf<ITest>();

Workaround for the moment is to use GetInterface but a more permanent solution should be found and it will be quite a common use case:

ScriptType type = null;
foreach( ScriptType t in assembly.FindAllTypes() )
{
//    if( typeof(ITest).IsAssignableFrom( t.SystemType ) ) <- DOESN'T WORK
    if( t.SystemType.GetInterface( nameof(ITest) ) == typeof(ITest) )
    {
        type = t;
        break;
    }
}

Event listeners are called twice

In the following example the 'MyEventHandler method will be called twice when the expected behaviour is that it should only be called once:

public class Example
{
    public event Action MyEvent;

    private void Run()
    {
        MyEvent += MyEventHandler;
        MyEvent();
    }

    private void MyEventHandler()
    {
        Debug.Log("Event called");
    }
}

Other info:
Some initial debugging has been carried out and it appears that the delegate created by __delegate contains duplicate invocation targets. It is not clear yet how or why the listeners are duplicated and will rquire more investigation.

Generics remain null after declaration/assignment

Error: Failed to compile/create instance: System.TypeLoadException: Type context must be provided when resolving a generic argument type

Example scripted method being called with above issue present:

        public void RunRefTypes(int iterations)
        {
            var myList = new ListPlaceholder();
            for (int i = 0; i < 5; ++i)
            {
                myList.Add(i);
            }
            myList.Remove(2);
            myList.AddRange(new int[] {5, 6, 7});
            Debug.Log($"List<int>: {myList}");
            
            var dict = new DictPlaceholder
            {
                { "hello", 42 }
            };
            dict.Add("world", 123);
            dict["test"] = 789;
            dict.Remove("test");
            if (dict.ContainsKey("test"))
            {
                Debug.LogError("Dictionary still contained removed key");
            }
            Debug.Log($"dict[hello]: {dict["hello"]}, dict[world]: {dict["world"]}");
            
            var sb = new StringBuilder();
            sb.Append("hello");
            sb.AppendLine(" world!");
            Debug.Log(sb.ToString());
        }

All of the variables above will throw a null ref exception after declaration. ListPlaceholder is just an empty class that inherits from List, similarly for DictPlaceholder, was experimenting with potential workarounds. Sent over repro project, just tracking the issue here, let me know if more details are required!

WebGL builds freezing when deployed

I found I have the same issue as lperner.
The conversation started from here https://discord.com/channels/816989640791556116/823542955289083945/1025442105675501619.

I followed the setup multiple times and using multiple versions of Unity all with the same result.
I fixed serialization issues I encountered by making sure the files all had unix style line endings.
Eventually I broke this down into a simple test and was able to create a domain, load assemblies and get to this point in the RoslynCSharpCompiler EmitCompilationObject function (called from CompileAndLoadSourcesInterpreted)
EmitResult emitResult = emitObject.Emit(targetStream, targetPDBStream, null, null, null, emitOptions);

if I returned before this call it works and I get all debug information in the browser window, if I return after this call the page locks up immediately and shows no debug information at all.

Let me know if the issue is in an acceptable format.
Cheers,
Pagey

Unwrapping types on proxies

When using MonoBehaviourProxy/CLRInstance unwrapping, dotnow checks for compatibility against base type and returns the baseProxy if it matches. This causes issues where attempting to unwrap an instance with certain types (e.g. Component) ends up returning the proxy in its original form instead of casting the runtime instance.

pseudo repro steps:
proxy.UnwrapAs()
proxy.instance.UnwrapAs()
returns proxy instead of type cast instance

Try/catch in runtime script methods

When using a try/catch block inside a runtime script it will not pass through into the catch due to the CLRExceptionHandler injecting its own try/catch at the first/last lines of a method.

NotSupportedException: Specified method is not supported. on setting interpreted array value via class with constructor

public class InterpretetedMono : MonoBehaviour
    {
        private void Start()
        {
            var array1 = new TestClass[1];
            array1[0] = new TestClass("134");
            Debug.Log("Start work!"); //output: Start work!
            
            InitTestArray();
        }

        public void InitTestArray()
        {
            var array2 = new TestClass[1];
            array2[0] = new TestClass("134"); //error here
            Debug.Log("Init work!");
        }

        class TestClass
        {
            public TestClass(string text)
            {
                Debug.Log("construct"); //output: construct
                NameKey = text;
                Debug.Log("construct1"); //output: construct1
            }

            public string NameKey;
        }
    }

if i am remove argument text from constructor then interpreted code work fine

errors log:

At method body: System.Void Game.InterpretetedMono::InitTestArray()
0x00007ff6633c8bdc (Unity) StackWalker::GetCurrentCallstack
0x00007ff6633cffd9 (Unity) StackWalker::ShowCallstack
0x00007ff66412cd9c (Unity) GetStacktrace
0x00007ff664b75e83 (Unity) DebugStringToFile
0x00007ff6634802f6 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x0000025034e9d30b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x0000025034e9d1ab (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000025109dcacee (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000002510cf359ea (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x0000025109de4d4b (Mono JIT Code) [ExecutionEngine.cs:182] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x0000025109de407b (Mono JIT Code) [CLRMethodBodyBase.cs:84] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x00000250bff2e90b (Mono JIT Code) [CILInterpreter.cs:2646] dotnow.Runtime.CIL.CILInterpreter:ExecuteInterpreted (dotnow.AppDomain,dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame&,dotnow.Runtime.CIL.CILOperation[]&,dotnow.Reflection.CLRExceptionHandler[]&,dotnow.Runtime.ExecutionEngine/DebugFlags) 
0x0000025109de4b53 (Mono JIT Code) [ExecutionEngine.cs:175] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x0000025109de407b (Mono JIT Code) [CLRMethodBodyBase.cs:84] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x000002510cf327cb (Mono JIT Code) [ExecutionMethod.cs:106] dotnow.Runtime.ExecutionMethod:DelegateInvoke (object) 
0x000002510cf32383 (Mono JIT Code) [CLRMethod.cs:295] dotnow.Reflection.CLRMethod/<>c__DisplayClass41_0:<CreateDelegate>b__0 () 
0x000002510cf31c00 (Mono JIT Code) [MonoBehaviourProxy.cs:265] UnityEngine.MonoBehaviourProxy:Start () 
0x00000250bfe39af8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe35c4f1e0 (mono-2.0-bdwgc) [mini-runtime.c:2849] mono_jit_runtime_invoke 
0x00007ffe35bd2ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
0x00007ffe35bdbb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
0x00007ff66330cd34 (Unity) scripting_method_invoke
0x00007ff663308011 (Unity) ScriptingInvocation::Invoke
0x00007ff6632dbfad (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff6632dc0d8 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff6632d6ce2 (Unity) MonoBehaviour::DelayedStartCall
0x00007ff662e4bfa4 (Unity) DelayedCallManager::Update
0x00007ff663044099 (Unity) `InitPlayerLoopCallbacks'::`2'::EarlyUpdateScriptRunDelayedStartupFrameRegistrator::Forward
0x00007ff66302c4dc (Unity) ExecutePlayerLoop
0x00007ff66302c5b3 (Unity) ExecutePlayerLoop
0x00007ff663033059 (Unity) PlayerLoop
0x00007ff663cefa91 (Unity) PlayerLoopController::UpdateScene
0x00007ff663cdbcef (Unity) PlayerLoopController::EnterPlayMode
0x00007ff663ceb11d (Unity) PlayerLoopController::SetIsPlaying
0x00007ff663cedf87 (Unity) Application::TickTimer
0x00007ff6641334d1 (Unity) MainMessageLoop
0x00007ff664137521 (Unity) WinMain
0x00007ff6657c5752 (Unity) __scrt_common_main_seh
0x00007ffec87f7034 (KERNEL32) BaseThreadInitThunk
0x00007ffec9b82651 (ntdll) RtlUserThreadStart

At instruction: Ldc_I4_1
0x00007ff6633c8bdc (Unity) StackWalker::GetCurrentCallstack
0x00007ff6633cffd9 (Unity) StackWalker::ShowCallstack
0x00007ff66412cd9c (Unity) GetStacktrace
0x00007ff664b75e83 (Unity) DebugStringToFile
0x00007ff6634802f6 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x0000025034e9d30b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x0000025034e9d1ab (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000025109dcacee (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000002510cf359ea (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x0000025109de4e73 (Mono JIT Code) [ExecutionEngine.cs:183] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x0000025109de407b (Mono JIT Code) [CLRMethodBodyBase.cs:84] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x00000250bff2e90b (Mono JIT Code) [CILInterpreter.cs:2646] dotnow.Runtime.CIL.CILInterpreter:ExecuteInterpreted (dotnow.AppDomain,dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame&,dotnow.Runtime.CIL.CILOperation[]&,dotnow.Reflection.CLRExceptionHandler[]&,dotnow.Runtime.ExecutionEngine/DebugFlags) 
0x0000025109de4b53 (Mono JIT Code) [ExecutionEngine.cs:175] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x0000025109de407b (Mono JIT Code) [CLRMethodBodyBase.cs:84] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x000002510cf327cb (Mono JIT Code) [ExecutionMethod.cs:106] dotnow.Runtime.ExecutionMethod:DelegateInvoke (object) 
0x000002510cf32383 (Mono JIT Code) [CLRMethod.cs:295] dotnow.Reflection.CLRMethod/<>c__DisplayClass41_0:<CreateDelegate>b__0 () 
0x000002510cf31c00 (Mono JIT Code) [MonoBehaviourProxy.cs:265] UnityEngine.MonoBehaviourProxy:Start () 
0x00000250bfe39af8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe35c4f1e0 (mono-2.0-bdwgc) [mini-runtime.c:2849] mono_jit_runtime_invoke 
0x00007ffe35bd2ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
0x00007ffe35bdbb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
0x00007ff66330cd34 (Unity) scripting_method_invoke
0x00007ff663308011 (Unity) ScriptingInvocation::Invoke
0x00007ff6632dbfad (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff6632dc0d8 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff6632d6ce2 (Unity) MonoBehaviour::DelayedStartCall
0x00007ff662e4bfa4 (Unity) DelayedCallManager::Update
0x00007ff663044099 (Unity) `InitPlayerLoopCallbacks'::`2'::EarlyUpdateScriptRunDelayedStartupFrameRegistrator::Forward
0x00007ff66302c4dc (Unity) ExecutePlayerLoop
0x00007ff66302c5b3 (Unity) ExecutePlayerLoop
0x00007ff663033059 (Unity) PlayerLoop
0x00007ff663cefa91 (Unity) PlayerLoopController::UpdateScene
0x00007ff663cdbcef (Unity) PlayerLoopController::EnterPlayMode
0x00007ff663ceb11d (Unity) PlayerLoopController::SetIsPlaying
0x00007ff663cedf87 (Unity) Application::TickTimer
0x00007ff6641334d1 (Unity) MainMessageLoop
0x00007ff664137521 (Unity) WinMain
0x00007ff6657c5752 (Unity) __scrt_common_main_seh
0x00007ffec87f7034 (KERNEL32) BaseThreadInitThunk
0x00007ffec9b82651 (ntdll) RtlUserThreadStart

At method body: System.Void Game.InterpretetedMono::Start()
0x00007ff6633c8bdc (Unity) StackWalker::GetCurrentCallstack
0x00007ff6633cffd9 (Unity) StackWalker::ShowCallstack
0x00007ff66412cd9c (Unity) GetStacktrace
0x00007ff664b75e83 (Unity) DebugStringToFile
0x00007ff6634802f6 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x0000025034e9d30b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x0000025034e9d1ab (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000025109dcacee (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000002510cf359ea (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x0000025109de4d4b (Mono JIT Code) [ExecutionEngine.cs:182] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x0000025109de407b (Mono JIT Code) [CLRMethodBodyBase.cs:84] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x000002510cf327cb (Mono JIT Code) [ExecutionMethod.cs:106] dotnow.Runtime.ExecutionMethod:DelegateInvoke (object) 
0x000002510cf32383 (Mono JIT Code) [CLRMethod.cs:295] dotnow.Reflection.CLRMethod/<>c__DisplayClass41_0:<CreateDelegate>b__0 () 
0x000002510cf31c00 (Mono JIT Code) [MonoBehaviourProxy.cs:265] UnityEngine.MonoBehaviourProxy:Start () 
0x00000250bfe39af8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe35c4f1e0 (mono-2.0-bdwgc) [mini-runtime.c:2849] mono_jit_runtime_invoke 
0x00007ffe35bd2ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
0x00007ffe35bdbb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
0x00007ff66330cd34 (Unity) scripting_method_invoke
0x00007ff663308011 (Unity) ScriptingInvocation::Invoke
0x00007ff6632dbfad (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff6632dc0d8 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff6632d6ce2 (Unity) MonoBehaviour::DelayedStartCall
0x00007ff662e4bfa4 (Unity) DelayedCallManager::Update
0x00007ff663044099 (Unity) `InitPlayerLoopCallbacks'::`2'::EarlyUpdateScriptRunDelayedStartupFrameRegistrator::Forward
0x00007ff66302c4dc (Unity) ExecutePlayerLoop
0x00007ff66302c5b3 (Unity) ExecutePlayerLoop
0x00007ff663033059 (Unity) PlayerLoop
0x00007ff663cefa91 (Unity) PlayerLoopController::UpdateScene
0x00007ff663cdbcef (Unity) PlayerLoopController::EnterPlayMode
0x00007ff663ceb11d (Unity) PlayerLoopController::SetIsPlaying
0x00007ff663cedf87 (Unity) Application::TickTimer
0x00007ff6641334d1 (Unity) MainMessageLoop
0x00007ff664137521 (Unity) WinMain
0x00007ff6657c5752 (Unity) __scrt_common_main_seh
0x00007ffec87f7034 (KERNEL32) BaseThreadInitThunk
0x00007ffec9b82651 (ntdll) RtlUserThreadStart

At instruction: Ldc_I4_1
0x00007ff6633c8bdc (Unity) StackWalker::GetCurrentCallstack
0x00007ff6633cffd9 (Unity) StackWalker::ShowCallstack
0x00007ff66412cd9c (Unity) GetStacktrace
0x00007ff664b75e83 (Unity) DebugStringToFile
0x00007ff6634802f6 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x0000025034e9d30b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x0000025034e9d1ab (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000025109dcacee (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000002510cf359ea (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x0000025109de4e73 (Mono JIT Code) [ExecutionEngine.cs:183] dotnow.Runtime.ExecutionEngine:Execute (dotnow.AppDomain,dotnow.Runtime.ExecutionFrame,dotnow.Runtime.CIL.CILOperation[],dotnow.Reflection.CLRExceptionHandler[],int,bool) 
0x0000025109de407b (Mono JIT Code) [CLRMethodBodyBase.cs:84] dotnow.Reflection.CLRMethodBodyBase:ExecuteMethodBody (dotnow.Runtime.ExecutionEngine,dotnow.Runtime.ExecutionFrame) 
0x000002510cf327cb (Mono JIT Code) [ExecutionMethod.cs:106] dotnow.Runtime.ExecutionMethod:DelegateInvoke (object) 
0x000002510cf32383 (Mono JIT Code) [CLRMethod.cs:295] dotnow.Reflection.CLRMethod/<>c__DisplayClass41_0:<CreateDelegate>b__0 () 
0x000002510cf31c00 (Mono JIT Code) [MonoBehaviourProxy.cs:265] UnityEngine.MonoBehaviourProxy:Start () 
0x00000250bfe39af8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe35c4f1e0 (mono-2.0-bdwgc) [mini-runtime.c:2849] mono_jit_runtime_invoke 
0x00007ffe35bd2ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
0x00007ffe35bdbb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
0x00007ff66330cd34 (Unity) scripting_method_invoke
0x00007ff663308011 (Unity) ScriptingInvocation::Invoke
0x00007ff6632dbfad (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff6632dc0d8 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00007ff6632d6ce2 (Unity) MonoBehaviour::DelayedStartCall
0x00007ff662e4bfa4 (Unity) DelayedCallManager::Update
0x00007ff663044099 (Unity) `InitPlayerLoopCallbacks'::`2'::EarlyUpdateScriptRunDelayedStartupFrameRegistrator::Forward
0x00007ff66302c4dc (Unity) ExecutePlayerLoop
0x00007ff66302c5b3 (Unity) ExecutePlayerLoop
0x00007ff663033059 (Unity) PlayerLoop
0x00007ff663cefa91 (Unity) PlayerLoopController::UpdateScene
0x00007ff663cdbcef (Unity) PlayerLoopController::EnterPlayMode
0x00007ff663ceb11d (Unity) PlayerLoopController::SetIsPlaying
0x00007ff663cedf87 (Unity) Application::TickTimer
0x00007ff6641334d1 (Unity) MainMessageLoop
0x00007ff664137521 (Unity) WinMain
0x00007ff6657c5752 (Unity) __scrt_common_main_seh
0x00007ffec87f7034 (KERNEL32) BaseThreadInitThunk
0x00007ffec9b82651 (ntdll) RtlUserThreadStart

NotSupportedException: Specified method is not supported.
dotnow.Runtime.CIL.CILInterpreter.ExecuteInterpreted (dotnow.AppDomain domain, dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame& frame, dotnow.Runtime.CIL.CILOperation[]& instructions, dotnow.Reflection.CLRExceptionHandler[]& exceptionHandlers, dotnow.Runtime.ExecutionEngine+DebugFlags debugFlags) (at Assets/Plugins/dotnow/Scripts/Runtime/CIL/CILInterpreter.cs:2268)
dotnow.Runtime.ExecutionEngine.Execute (dotnow.AppDomain domain, dotnow.Runtime.ExecutionFrame frame, dotnow.Runtime.CIL.CILOperation[] methodInstructions, dotnow.Reflection.CLRExceptionHandler[] exceptionHandlers, System.Int32 initialInstructionIndex, System.Boolean debuggerResume) (at Assets/Plugins/dotnow/Scripts/Runtime/ExecutionEngine.cs:190)
dotnow.Reflection.CLRMethodBodyBase.ExecuteMethodBody (dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame frame) (at Assets/Plugins/dotnow/Scripts/Reflection/CLRMethodBodyBase.cs:84)
dotnow.Runtime.CIL.CILInterpreter.ExecuteInterpreted (dotnow.AppDomain domain, dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame& frame, dotnow.Runtime.CIL.CILOperation[]& instructions, dotnow.Reflection.CLRExceptionHandler[]& exceptionHandlers, dotnow.Runtime.ExecutionEngine+DebugFlags debugFlags) (at Assets/Plugins/dotnow/Scripts/Runtime/CIL/CILInterpreter.cs:2646)
dotnow.Runtime.ExecutionEngine.Execute (dotnow.AppDomain domain, dotnow.Runtime.ExecutionFrame frame, dotnow.Runtime.CIL.CILOperation[] methodInstructions, dotnow.Reflection.CLRExceptionHandler[] exceptionHandlers, System.Int32 initialInstructionIndex, System.Boolean debuggerResume) (at Assets/Plugins/dotnow/Scripts/Runtime/ExecutionEngine.cs:190)
dotnow.Reflection.CLRMethodBodyBase.ExecuteMethodBody (dotnow.Runtime.ExecutionEngine engine, dotnow.Runtime.ExecutionFrame frame) (at Assets/Plugins/dotnow/Scripts/Reflection/CLRMethodBodyBase.cs:84)
dotnow.Runtime.ExecutionMethod.DelegateInvoke (System.Object obj) (at Assets/Plugins/dotnow/Scripts/Runtime/ExecutionMethod.cs:106)
dotnow.Reflection.CLRMethod+<>c__DisplayClass41_0.<CreateDelegate>b__0 () (at Assets/Plugins/dotnow/Scripts/Reflection/CLRMethod.cs:295)
UnityEngine.MonoBehaviourProxy.Start () (at Assets/Plugins/dotnow/Scripts/Integration/Unity/MonoBehaviourProxy.cs:265)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.