This documentation is archived and is not being maintained.

ProcessInfo Class

Provides information on processes currently executing.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)

<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class ProcessInfo
Dim instance As ProcessInfo

This class returns information about ASP.NET worker processes that are running under the ASP.NET process model. Objects of this type are returned by the static methods ProcessModelInfo.GetCurrentProcessInfo and ProcessModelInfo.GetHistory. These methods are the only useful ways to create an initialized object.


If you are using Microsoft Internet Information Services (IIS) 6.0, process metrics returned by the ProcessInfo classes are available only if you are running in IIS 5.0 isolation mode. If you are using IIS 6.0 in worker process isolation mode, the ASP.NET process model is disabled and an HttpException exception is thrown when you access ProcessInfo members.

The following code example demonstrates using the Age, PeakMemoryUsed, ProcessID, RequestCount, ShutdownReason, StartTime and Status properties of the ProcessInfo class. The example displays a LinkButton. When the LinkButton is clicked, the current process information is displayed.

<%@ Page language="vb" AutoEventWireup="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
<html xmlns="" >
    <title>ASP.NET Example</title>
<script language="vb" runat="server">     
      Sub GetProcessInfo(sender As Object, e As System.EventArgs)
        Dim pi As ProcessInfo

        'Get information about the current process.
        pi = ProcessModelInfo.GetCurrentProcessInfo()

        Literal1.Text = "<p>Age: " & pi.Age.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>PeakMemoryUsed: " & pi.PeakMemoryUsed.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>ProcessID: " & pi.ProcessID.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>RequestCount: " & pi.RequestCount.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>ShutdownReason: " & pi.ShutdownReason.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>StartTime: " & pi.StartTime.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>Status: " & pi.Status.ToString & "</p>" 
      End Sub
    <form id="WebForm2" method="post" runat="server">
      <asp:button id="Button1" OnClick="GetProcessInfo" runat="server" Text="Get Process Info"></asp:button>
      <asp:Literal id="Literal1" runat="server"></asp:Literal>


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0