Search Unity

System.NotSupportedException in unity 2019 only in Build mode

Discussion in 'Windows' started by PaulKamma, Sep 11, 2019.

  1. PaulKamma

    PaulKamma

    Joined:
    Apr 17, 2013
    Posts:
    2
    We use the AxSeriel COM Driver from https://www.activexperts.com/serial-port-component/ . It's a DLL that is placed in the Scripts folder and then used in c#.

    In the Editor everything works fine but when we create a build we get the NotSupportedException error thrown.
    The Whole construct worked with the 2018 Version of Unity, after the Update this problem appeared.

    Code (csharp):
    1. System.NotSupportedException: Specified method is not supported.
    2.   at (wrapper cominterop) AxSerial.ComPortClass..ctor()
    3.   at MyNamespace.Serial.SerialManager.initComponents () [0x0005d] in C:\Users\MYUSER\Documents\Unity\MYPROJECT\Assets\Scripts\Serial\SerialManager.cs:86
    4.  
    We've tried verious solutions that we found all over the internet loke creating a DLL folder in the Assets root and palce the dll there and alos copy itin the Unity/Editor folder etc. Nothing worked :/

    Maybe someone have a Hint/Solution for this problem.

    Thanks.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Which platform are you building to? Did you try using IL2CPP scripting backend?

    What API Compatibility level are you using? Could you try using .NET 4.x?
     
    PaulKamma likes this.
  3. PaulKamma

    PaulKamma

    Joined:
    Apr 17, 2013
    Posts:
    2
    Ok it works with .NET 4.x. Didn't thought of that.
    Thank you.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    The reason this worked in the editor is because the editor always runs in .NET 4.x mode, regardless of the player setting.
     
  5. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13

    Hi i'm using 4.x and il2cpp. When i try to connect my database on my android device i'm getting this error:
    method body replaced by unityLinker.exe with a notsupportedexception

    Mono method works fine on android device but i don't know why its says this when i use il2cpp
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Can you provide the full error message and the stack trace?
     
    CrossV4 likes this.
  7. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13
    I can't but i can explain more now. After hundred tries i found source of this issue. "Managed Stripping Level". When it's enables Low, MEdium or High doesn't matter Issue comes out. Mono or IL2CPP doesn't matter both mode gives this error when managed stripping level enables. I don't took any error in mono because i can disable it. But IL2CPP can't. How can bypass this mode. I read documentation of Managed Stripping Level it says removing unreachable codes. I don't want it. It's killing my game. I can't publish my game with this issue. My game is like a trash and totally waste of time if this issue can't be resolved. Also my other online games because i use them too this plugins. By the way is there any way to bypass to deleting unreachable codes or totally disabling the stripping method in IL2CPP .?
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    As mentioned in the "Link XML" section of the documentation here: https://docs.unity3d.com/Manual/ManagedCodeStripping.html, you can add a link.xml file to your project to indicate which assemblies, namespaces, or types should always be preserved.
     
    CrossV4 likes this.
  9. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13

    Code (CSharp):
    1. <linker>
    2.     <assembly fullname="MySql.Data" preserve="all">
    3.         <type fullname="*" preserve="all"/>
    4.     </assembly>
    5.     <assembly fullname="Newtonsoft.Json" preserve="all">
    6.         <type fullname="*" preserve="all"/>
    7.     </assembly>
    8.     <assembly fullname="Assembly-CSharp" preserve="all">
    9.         <type fullname="*" preserve="all"/>
    10.     </assembly>
    11.     <assembly fullname="System" preserve="all"/>
    12.     <assembly fullname="UnityEngine" preserve="all"/>
    13.     <assembly fullname="mscorlib" preserve="all"/>
    14. </linker>

    I allready made this yesterday and also i tried 45 times over with changing something but no it doesn't changed anything. Package size chganged so seems linker doing something but my plugins or my code still doesn't work. What i must do ?, i'm really confused.
     
  10. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    I think the best option now if to try to get a full stack trace when the error occurs. Maybe this is unrelated to managed cod stripping entirely.
     
    CrossV4 likes this.
  11. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13
    I finally achived catch stack trace here it is:

    Code (CSharp):
    1. AndroidPlayer(ADB@127.0.0.1:34999) NotSupportedException: Method body replaced by UnityLinker.exe with a NotSupportedException
    2.   at System.Data.DataCommonEventSource.Trace (System.String message) [0x00000] in <00000000000000000000000000000000>:0
    3.   at System.Data.Common.DbConnectionStringBuilder.Clear () [0x00000] in <00000000000000000000000000000000>:0
    4.   at MySql.Data.MySqlClient.MySqlConnectionStringBuilder.Clear () [0x00000] in <00000000000000000000000000000000>:0
    5.   at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString (System.String value) [0x00000] in <00000000000000000000000000000000>:0
    6.   at MySql.Data.MySqlClient.MySqlConnectionStringBuilder..ctor (System.String connStr) [0x00000] in <00000000000000000000000000000000>:0
    7.   at MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString (System.String value) [0x00000] in <00000000000000000000000000000000>:0
    8.   at MySql.Data.MySqlClient.MySqlConnection..ctor (System.String connectionString) [0x00000] in <00000000000000000000000000000000>:0
    9.   at ui_event_catcher.reconnect () [0x00000] in <00000000000000000000000000000000>:0
    10.   at UnityEngine.Events.InvokableCall.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    11.   at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    12.   at UnityEngine.UI.Button.Press () [0x00000] in <00000000000000000000000000000000>:0
    13.   at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
    14.   at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
    15.   at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0
    16.   at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000] in <00000000000000000000000000000000>:0
    17.   at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () [0x00000] in <00000000000000000000000000000000>:0
    18.   at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <00000000000000000000000000000000>:0
    19.   at UnityEngine.EventSystems.EventSystem.Update () [0x00000] in <00000000000000000000000000000000>:0
    20. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    21. UnityEngine.Logger:LogException(Exception, Object)
    22. UnityEngine.Debug:LogException(Exception)
    23. UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
    24. UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
    25. UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
    26. UnityEngine.EventSystems.StandaloneInputModule:Process()
    27. UnityEngine.EventSystems.EventSystem:Update()
    28. (Filename: currently not available on il2cpp Line: -1)
    29.  
    30.  
    31.  
    Can you help me please ?
     
  12. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Can you try to add this line to the link.xml file?

    <assembly fullname="System.Data" preserve="all"/>

    It looks like the code here is in System.Data.dll. I don't think the the linker should be removing this code though, so I'm still unclear why this is happening. But lets start here to see if you can work around the issue.
     
    CrossV4 likes this.
  13. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13
    Hi again i added line but still not working. Also i guess nothing doesn't changed yet. But package size increased. So i think we are going to solve this issue.
    here is new link.xml:
    Code (CSharp):
    1.  
    2. <linker>
    3.     <assembly fullname="MySql.Data" preserve="all">
    4.         <type fullname="*" preserve="all"/>
    5.     </assembly>
    6.     <assembly fullname="Newtonsoft.Json" preserve="all">
    7.         <type fullname="*" preserve="all"/>
    8.     </assembly>
    9.     <assembly fullname="Assembly-CSharp" preserve="all">
    10.         <type fullname="*" preserve="all"/>
    11.     </assembly>
    12.     <assembly fullname="System" preserve="all"/>
    13.     <assembly fullname="System.Data" preserve="all"/>
    14.     <assembly fullname="UnityEngine.CoreModule" preserve="all"/>
    15.     <assembly fullname="mscorlib" preserve="all"/>
    16. </linker>
    17.  
    here is new stack trace:
    Code (CSharp):
    1. AndroidPlayer(ADB@127.0.0.1:34999) NotSupportedException: Method body replaced by UnityLinker.exe with a NotSupportedException
    2.   at System.Data.DataCommonEventSource.Trace (System.String message) [0x00000] in <00000000000000000000000000000000>:0
    3.   at System.Data.Common.DbConnectionStringBuilder.Clear () [0x00000] in <00000000000000000000000000000000>:0
    4.   at MySql.Data.MySqlClient.MySqlConnectionStringBuilder.Clear () [0x00000] in <00000000000000000000000000000000>:0
    5.   at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString (System.String value) [0x00000] in <00000000000000000000000000000000>:0
    6.   at MySql.Data.MySqlClient.MySqlConnectionStringBuilder..ctor (System.String connStr) [0x00000] in <00000000000000000000000000000000>:0
    7.   at MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString (System.String value) [0x00000] in <00000000000000000000000000000000>:0
    8.   at MySql.Data.MySqlClient.MySqlConnection..ctor (System.String connectionString) [0x00000] in <00000000000000000000000000000000>:0
    9.   at ui_event_catcher.reconnect () [0x00000] in <00000000000000000000000000000000>:0
    10.   at UnityEngine.Events.InvokableCall.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    11.   at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    12.   at UnityEngine.UI.Button.Press () [0x00000] in <00000000000000000000000000000000>:0
    13.   at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
    14.   at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
    15.   at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0
    16.   at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000] in <00000000000000000000000000000000>:0
    17.   at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () [0x00000] in <00000000000000000000000000000000>:0
    18.   at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <00000000000000000000000000000000>:0
    19.   at UnityEngine.EventSystems.EventSystem.Update () [0x00000] in <00000000000000000000000000000000>:0
    20. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    21. UnityEngine.Logger:LogException(Exception, Object)
    22. UnityEngine.Debug:LogException(Exception)
    23. UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
    24. UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
    25. UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
    26. UnityEngine.EventSystems.StandaloneInputModule:Process()
    27. UnityEngine.EventSystems.EventSystem:Update()
    28. (Filename: currently not available on il2cpp Line: -1)
    29.  
    30.  
    31.  
     
    Last edited: Mar 9, 2021
  14. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Huh, it looks like nothing changed there. That is very odd. As a sanity check, how is the MySql.Data.dll compiled? Is it compiled against .NET Standard 2.0? Or is is compiled against .NET Framework?
     
    CrossV4 likes this.
  15. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13
    MySqlConnector 6.9 version working on .NET 4.5 version. But i have also older version for .NET 3.5. I tried it too.
     
  16. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Ok, the .NET 4.5 version should work. Can you submit a bug report with this project? Something is wrong here that I do not understand.
     
    CrossV4 likes this.
  17. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13
    I did. is there anything to i should do something or try something .?
     
  18. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    We will need to investigate the issue. What is the bug report number?
     
    CrossV4 likes this.
  19. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13
    Case : 1320392
     
    JoshPeterson likes this.
  20. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13
    Hı Josh;

    I came back with detailed issue. After deep searching of all stack trace by one by i found the complete source of issue.

    MySQLConnection is uses MySqlConnectionStringBuilder when connection is building, after building connection is calling MySqlConnectionStringBuilder.Clear(). The issue comes here. This is Also called IDictionary.Clear() from System.Collections.cll and mscorlib.dll.

    IDictionary.Clear() methods throws NotSupportedException when it's readonly. I cannot change MySqlConnectionStringBuilder dictionary to editable. Method has only get; property.
    So this issue always will come up. If an error occurs in the code, the codes below will be not read and execute. So if i can bypass the exception, the codes below from exception are will read and executed .?
    If yes i think i can handle this with try catch am i wrong ?.

    Also what happens during stripping assemblies to this error comes up. With stripping assemblies disabled MySqlConnection clearly call MySqlConnectionStringBuilder.Clear() with no error. I don't understand what stripping assemblies exactly doing.

    This is MySqlConnectionStringBuilder class's document:
    https://dev.mysql.com/doc/dev/conne..._MySqlClient_MySqlConnectionStringBuilder.htm

    This is MySqlConnectionStringBuilder.Clear method's document:
    https://dev.mysql.com/doc/dev/conne...Client_MySqlConnectionStringBuilder_Clear.htm

    This is IDictionary.Clear method's document !! SOURCE OF ERROR !!:
    https://docs.microsoft.com/en-us/do...=net-5.0#System_Collections_IDictionary_Clear
     
  21. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Thanks for the additional details. I'm still unsure what is causing this issue. Our QA team is processing the bug report you submitted - once they do that we will investigate it.
     
  22. deters

    deters

    Joined:
    Aug 19, 2015
    Posts:
    6
    Have the same exception when using DataTable.

    Code (CSharp):
    1.  var dataTable = new DataTable();
    2. dataTable.Columns.Add("result", typeof(string), input);
    Tryied add link. xml, but still have error

    <?xml version="1.0" encoding="utf-8" ?>
    <linker>
    <assembly fullname="System.Data" preserve="all"/>
    </linker>

    Method body replaced by UnityLinker.exe with a NotSupportedException at System.Data.DataCommonEventSource.ExitScope (System.Int64 scopeId) [0x00000] in <00000000000000000000000000000000>:0
    03-18 13:04:58.503 29905 30068 E Unity : at System.Data.DataColumn.set_Expression (System.String value) [0x00000] in <00000000000000000000000000000000>:0
    03-18 13:04:58.503 29905 30068 E Unity : at System.Data.DataColumn..ctor (System.String columnName, System.Type dataType, System.String expr, System.Data.MappingType type) [0x00000] in <00000000000000000000000000000000>:0
    03-18 13:04:58.503 29905 30068 E Unity : at System.Data.DataColumn..ctor (System.String columnName, System.Type dataType, System.String expr) [0x00000] in <00000000000000000000000000000000>:0
    03-18 13:04:58.503 29905 30068 E Unity : at System.Data.DataColumnCollection.Add (System.String columnName, System.Type type, System.String expression) [0x00000] in <00000000000000000000000000000000>:0
     
  23. An_to

    An_to

    Joined:
    Apr 13, 2021
    Posts:
    1
    Hi,
    I have the same problem as you. Did you manage to fix the problem?
    Thank you
     
  24. aaronm64

    aaronm64

    Joined:
    Nov 24, 2018
    Posts:
    17
    I have this error as well. Any updates?

    I get the stack trace below. The similarity seems to be these are both `EventSource` subclasses, with a method having the `EventAttribute` attribute.
    I get this in Unity 2021.1 and 2021.2 when using IL2CPP, with API Compatibility Level set to .NET Standard 2.1, or .NET Framework

    Code (CSharp):
    1. System.NotSupportedException: Method body replaced by UnityLinker.exe with a NotSupportedException
    2.   at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionsEventSource.ConnectionStart (System.String connectionId) [0x00000] in <00000000000000000000000000000000>:0
    3.   at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionManager.CreateConnection (System.IO.Pipelines.PipeOptions transportPipeOptions, System.IO.Pipelines.PipeOptions appPipeOptions) [0x00000] in <00000000000000000000000000000000>:0
    4.   at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionDispatcher.CreateConnection (Microsoft.AspNetCore.Http.Connections.HttpConnectionDispatcherOptions options) [0x00000] in <00000000000000000000000000000000>:0
    5.   at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionDispatcher.ProcessNegotiate (Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.Connections.HttpConnectionDispatcherOptions options, Microsoft.AspNetCore.Http.Connections.Internal.ConnectionLogScope logScope) [0x00000] in <00000000000000000000000000000000>:0
    6.   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
    7.   at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionDispatcher.ProcessNegotiate (Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.Connections.HttpConnectionDispatcherOptions options, Microsoft.AspNetCore.Http.Connections.Internal.ConnectionLogScope logScope) [0x00000] in <00000000000000000000000000000000>:0
    8.   at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionDispatcher.ExecuteNegotiateAsync (Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.Connections.HttpConnectionDispatcherOptions options) [0x00000] in <00000000000000000000000000000000>:0
    9.   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
    10.   at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionDispatcher.ExecuteNegotiateAsync (Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.Connections.HttpConnectionDispatcherOptions options) [0x00000] in <00000000000000000000000000000000>:0
    11.   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext httpContext) [0x00000] in <00000000000000000000000000000000>:0
    12.   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
    13.   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext httpContext) [0x00000] in <00000000000000000000000000000000>:0
    14.   at Microsoft.AspNetCore.WebSockets.WebSocketMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext context) [0x00000] in <00000000000000000000000000000000>:0
    15.   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext httpContext) [0x00000] in <00000000000000000000000000000000>:0
    16.   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext] (Microsoft.AspNetCore.Hosting.Server.IHttpApplication`1[TContext] application) [0x00000] in <00000000000000000000000000000000>:0
    17.   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    18.   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in <00000000000000000000000000000000>:0
    19.   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    20.   at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00000] in <00000000000000000000000000000000>:0
    21. --- End of stack trace from previous location where exception was thrown ---
    22.  
    23.   at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionDispatcher.ExecuteNegotiateAsync (Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.Connections.HttpConnectionDispatcherOptions options) [0x00000] in <00000000000000000000000000000000>:0
    24.   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
    25.   at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionDispatcher.ExecuteNegotiateAsync (Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.Connections.HttpConnectionDispatcherOptions options) [0x00000] in <00000000000000000000000000000000>:0
    26.   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext httpContext) [0x00000] in <00000000000000000000000000000000>:0
    27.   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
    28.   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext httpContext) [0x00000] in <00000000000000000000000000000000>:0
    29.   at Microsoft.AspNetCore.WebSockets.WebSocketMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext context) [0x00000] in <00000000000000000000000000000000>:0
    30.   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext httpContext) [0x00000] in <00000000000000000000000000000000>:0
    31.   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext] (Microsoft.AspNetCore.Hosting.Server.IHttpApplication`1[TContext] application) [0x00000] in <00000000000000000000000000000000>:0
    32.   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    33.   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in <00000000000000000000000000000000>:0
    34.   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    35.   at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00000] in <00000000000000000000000000000000>:0
    36. --- End of stack trace from previous location where exception was thrown ---
    37.  
    38.   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext httpContext) [0x00000] in <00000000000000000000000000000000>:0
    39.   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
    40.   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext httpContext) [0x00000] in <00000000000000000000000000000000>:0
    41.   at Microsoft.AspNetCore.WebSockets.WebSocketMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext context) [0x00000] in <00000000000000000000000000000000>:0
    42.   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.Invoke (Microsoft.AspNetCore.Http.HttpContext httpContext) [0x00000] in <00000000000000000000000000000000>:0
    43.   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext] (Microsoft.AspNetCore.Hosting.Server.IHttpApplication`1[TContext] application) [0x00000] in <00000000000000000000000000000000>:0
    44.   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    45.   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in <00000000000000000000000000000000>:0
    46.   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    47.   at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00000] in <00000000000000000000000000000000>:0
    48. --- End of stack trace from previous location where exception was thrown ---
    49.  
     
  25. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    It looks like our QA team was unable to reproduce the problem in the initial bug report, so we've not investigated this issue.

    Did this code work in versions of Unity prior to 2021.1?