Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3330696
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:30:55+00:00 2026-05-17T23:30:55+00:00

In ASP.NET: How can I tell when the ASP.NET worker process last restarted? In

  • 0

In ASP.NET:

  1. How can I tell when the ASP.NET worker process last restarted?

  2. In ASP.NET, how can I tell when the app domain last recycled?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:30:56+00:00Added an answer on May 17, 2026 at 11:30 pm

    For the worker process, you can programmatically read Process -> Elapsed Time from the corresponding perf. counter (1) or directly from the System.Diagnostics.Process namespace; for the AppDomain, you can set an application-level variable at start-up to serve as your baseline and measure against that manually.

    Scott Mitchell actually has a couple of good posts on this that are still relevant 8 years later, believe it or not (2). Running on Cassini (Vista, VS 2008), I’m seeing an accurate system up-time with:

    TimeSpan.FromMilliseconds(Environment.TickCount)
    

    …and accurate Process/AppDomain up-times with these:

    foreach (Process p in Process.GetProcessesByName("WebDev.WebServer"))
    {
        Response.Write(DateTime.Now.Subtract(p.StartTime).ToString() + "<br/>");
    }
    
    Response.Write(DateTime.Now.Subtract((DateTime)Application["StartTime"]).ToString());
    

    I’m also able to obtain the correct PerfomanceCounter, but can’t seem to read the correct value (always zero, under my setup):

    Response.Write(new PerformanceCounter("Process", "Elapsed Time", "WebDev.WebServer").NextValue() + "<br/>");
    

    Scott’s articles are definitely worth a read – there’s a wealth of info in ProcessInfo and ProcessModelInfo (eg. ProcessModelInfo.GetHistory), but unfortunately it’s not available on Cassini:

    Process metrics are available only
    when the ASP.NET process model is
    enabled. When running on versions of
    IIS 6 or newer in worker process
    isolation mode, this feature is not
    supported.

    UPDATE:
    great explanation of how to read the counter correctly to avoid the zero on NextValue(): Link

    HTH

    (1) https://serverfault.com/questions/90927/lifetime-of-iis-worker-process-or-appdomai

    (2) https://web.archive.org/web/20211020113638/https://www.4guysfromrolla.com/articles/041002-1.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to update jquery1.3.2 to jquery1.4 (in Asp.net MVC). Please can anyone tell
Can any one tell me how can I make divs visible in ASP.NET. I
Can any one tell me how to solve the following scenario in Asp.net application.
I have two ASP.NET sites (they can not run in the same process) and
As far as I can tell the recommended approach for ASP.NET MVC 1 is
I'm playing around with inline code blocks in asp.net. Can somebody tell me why
Im new at ASP.net. I hope you can tell me the answer about this
Could anyone can tell me where I can find full ASP.NET MVC beta documentation?
I am using C# ASP.NET 4. So far as I can tell, the HttpWebRequest
I'm developing an ASP.NET MVC app and I'm a bit curious if anyone can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.