I am writing the code for a RESTful web service status page. I was wondering if there is away to get the current request from IIS into C#.
I am using IIS 7.0 and the info I want is under
IIS > Worker procecces > ASP.NET v4.0 > Requests
I am writing the code for a RESTful web service status page. I was wondering if there is away to get the current request from IIS into C#.
I am using IIS 7.0 and the info I want is under
IIS > Worker procecces > ASP.NET v4.0 > Requests
You can use the
GetRequests
method of theWorkerProcess
type. This type is located in theMicrosoft.Web.Administration
assembly which can be installed using this unofficial nuget package or by adding a reference to this dll%WinDir%\System32\InetSrv\Microsoft.Web.Administration.dll
Example:
Note: You need to have the IIS Request Manager feature enabled and also run with a user with sufficient permissions. See How do I see currently executing web request on IIS 8