Issue in WS 2019 that does not show in WS2016RSS

3 replies

Last post Jan 15, 2021 02:16 AM by Brucz

  • Issue in WS 2019 that does not show in WS2016

    Jan 13, 2021 08:53 PM|WillDiamond|LINK

    We have a simple IIS application that makes a call to an outside api.  It works fine on all (5) our IIS servers, except for our Production server (naturally...)  I am adding the error message at the bottom of this post.

    The 2 environmental differances of note are that the Production server is an Azure IIS Server, and it is the only one that has Windows Server 2019 OS.

    Our developer is trying to resolve it, but it feels like he is spinning.

    Any suggestions?


    Server Error in '/RushiTest' Application.
    A circular reference was detected while serializing an object of type 'System.RuntimeType'. 
      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
     Exception Details: System.InvalidOperationException: A circular reference was detected while serializing an object of type 'System.RuntimeType'.
    Source Error: 
     An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

  • Re: Issue in WS 2019 that does not show in WS2016

    Jan 14, 2021 02:30 AM|Brucz|LINK

    Hi WillDiamond,

    This is a very strange problem. I checked the upgrade of windows server2019 compared to 2016, but these upgrades will not affect the operation of the application.

    I think the serialization library used by the application may behave differently in different versions of the server. If you have other versions of windows server, you can run on it to see the results.

    You can add  [ScriptIgnore] in your Class property to tell not to serialize object that may cause such a circulate issue. This attribute will ignore the serialization of the object or class and will be empty in the output Json. Then you can define a simple serialization method to serialize the class or object.

    Or reduce the circular reference of the object, assign the object that needs to be serialized to a new object, and then serialize the new object.

    Best regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: Issue in WS 2019 that does not show in WS2016

    Jan 14, 2021 09:33 PM|WillDiamond|LINK

    Thanks for the suggestion, I passed it along to the developer.

  • Re: Issue in WS 2019 that does not show in WS2016

    Jan 15, 2021 02:16 AM|Brucz|LINK

    Hi WillDiamond,

    I suggest you use Json.net. This library has more powerful functions and can solve many serialization problems. You can try it.

    Best regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.