Skip to content

Instantly share code, notes, and snippets.

@doeringp
Created April 27, 2017 05:33
Show Gist options
  • Save doeringp/1431c55f5755b11d61e75f832ff22ae5 to your computer and use it in GitHub Desktop.
Save doeringp/1431c55f5755b11d61e75f832ff22ae5 to your computer and use it in GitHub Desktop.
Get the Correlation Id of the current request in SharePoint
public partial class overview : Page
{
[DllImport("advapi32.dll")]
public static extern uint EventActivityIdControl(uint controlCode, ref Guid activityId);
protected void Page_Load(object sender, EventArgs e)
{
var correlationId = new Guid();
EventActivityIdControl(1, ref correlationId);
// Now you have the current correlation id.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment