locked
HttpRequestMessage.GetCorrelationId() always returns same Guid for different request RRS feed

  • Question

  • User1155380077 posted

    HttpRequestMessage.GetCorrelationId() always returns same Guid for different request. Is there any IIS or System configuration that could solve this problem? This is happening in my ASP.NET Web API app deployed to Window Server 2012 with .NET framework 4.7.1.

    Wednesday, August 8, 2018 1:44 PM

All replies

  • User283571144 posted

    Hi Mighty_J,

    As far as I know, the GetCorrelationId method returns the GUID that will be associated with the HttpRequestMessage that is passed as a parameter.

    The value is created on the first call associated to a particular HttpRequestMessage object and then will retain that value for the same object throughout.

    So, yes, you should see duplicates from the method as this would indicate that you are handling the same HttpRequestMessage object in those instances. 

    Best Regards,

    Brando

    Thursday, August 9, 2018 7:21 AM
  • User1155380077 posted

    Same code works good(i.e., generates distinct correlationId) in our local VMs where as issue exists only in production environment.

    This has something to do with ApplicationHost.config(IIS configuration). It has gone away when I did a wrong time format in applicationHost.config after taking a backup. When I put back the original applicationHost.config with correct time format, issue reappears.

    Wrong format I tried is bolded- <periodicRestart memory="0" privateMemory="0" requests="0" time="1.05:00:00">

    Thursday, August 9, 2018 2:35 PM