5

I'm writing a windows service application in C# (.NET Framework 4.5) for Microsoft Windows Server 2012 R2 Standard x64 (IIS 8.5) and using Microsoft.Web.Administration.dll (7.0.0.0 from C:\Windows\System32\inetsrv).

When I run the following code:

using(var srvmngr = new Microsoft.Web.Administration.ServerManager())
{
    foreach(var pl in srvmngr.ApplicationPools)
    {
         foreach (var w3wp in pl.WorkerProcesses)
         {
             foreach (var request in w3wp.GetRequests(0))
             {
                 var success = true;
             }
        }
    }
}

The Service starts with administrator privileges and "GetRequests(0)" method raises the following exception:

System.NotImplementedException - {"The method or operation is not implemented."}

StackTrace:

at Microsoft.Web.Administration.Interop.IAppHostMethodInstance.Execute()
at Microsoft.Web.Administration.ConfigurationMethodInstance.Execute()
at Microsoft.Web.Administration.WorkerProcess.GetRequests(Int32 timeElapsedFilter)

Got the same exception in PowerShell using the following code:

PS > [System.Reflection.Assembly]::LoadFrom("C:\windows\system32\inetsrv\Microsoft.We‌​‌​b.Administration.dll" )
PS > $sm = new-object Microsoft.Web.Administration.ServerManager
PS > $sm.workerprocesses | foreach-object {$_.GetRequests(0)}

Can someone advice me?

Kiquenet
  • 14,494
  • 35
  • 148
  • 243
  • 1
    Got the same "Not Implemented" exception using the following command: `%systemroot%\system32\inetsrv\appcmd list requests` – Andrii Motrych Oct 14 '13 at 12:00

1 Answers1

11

I finally have solved my problem.

Follow the steps below to complete this problem: Add Roles and Features Wizard -> Server Roles -> Web Server (IIS) -> Web Server -> Health and Diagnostics -> Request Monitor

  • Please accept your answer to indicate to others that it solves your problem. – Oliver Jun 12 '14 at 12:07
  • In my case, this error started occuring after installing the "Dynamic IP Restrictions" IIS plugin (worked fine previously). Haven't found a solution yet. Obviously Request Monitor is still installed. – pkExec Apr 15 '16 at 11:20