469,954 Members | 1,911 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,954 developers. It's quick & easy.

When Did App Pool or Web Application Start?

I need to know from within my ASP.NET 2.0 Web Service, when the
application was started as a DateTime. The service might run on
Windows Server 2000, maybe 2003, maybe 2003 R2, maybe XP (in
development on my desktop), so it might run inside an App Pool, or it
might just be a virtual directory.

How can I get this information?

Thanks.

Feb 13 '07 #1
3 3240
Hello Lucius,

Yes, as you said, in IIS5 and IIS6, ASP.NET application(or other IIS hosted
server-side application) will have different process model. On IIS5, it
doesn't use application pool model, and use the "Protection Level" to
determine the worker process isolation model. While in IIS6, it use
application pool model, thus, any applications share the same application
pool will be hosted in the same worker process.
For your scenario, if what you want to get is the startup point of the
ASP.NET application, you can consider using the ASP.NET application(Global
object)'s Start event to capture the startup time(this event is fired only
once during an ASP.NET application's lifecycle).

#INFO: Application Instances, Application Events, and Application State in
ASP.NET
http://support.microsoft.com/kb/312607/en-us

e.g.

========================
namespace WebApplication1
{
public class Global : System.Web.HttpApplication
{

protected void Application_Start(object sender, EventArgs e)
{
//log the time here...
}
..................

========================

Also, if you need to retrieve this info out-side. You can consider writing
it into a log file or create a custom performance counter so that external
applications can also access this values.

Here is a MSDN reference and web articles which detailedly describe other
server-side events associated with ASP.NET runtime lifecycle:

#ASP.NET Application Life Cycle Overview
http://msdn2.microsoft.com/en-us/library/ms178473.aspx

http://www.eggheadcafe.com/tutorials...-a1f2-e68b28db
e836/restart-aspnet-apps-prog.aspx

http://weblogs.asp.net/scottgu/archi...14/433194.aspx

Hope helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 14 '07 #2
On Feb 13, 10:51 pm, lucius <luc...@newsgroup.nospamwrote:
I need to know from within my ASP.NET 2.0 Web Service, when the
application was started as a DateTime. The service might run on
Windows Server 2000, maybe 2003, maybe 2003 R2, maybe XP (in
development on my desktop), so it might run inside an App Pool, or it
might just be a virtual directory.

How can I get this information?
Create a Global.asax and set some publicly available property of type
DateTime in the "Application_Start" method...

..t

--
http://ajaxwidgets.com
Free ASP.NET Ajax Widgets NOW!

Feb 15 '07 #3
Hello Lucius,

Any further questions on this or does the information in previous replies
help you some? Please feel free to post here if there is anything else we
can help.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 19 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Lars Netzel | last post: by
3 posts views Thread by Diffident | last post: by
3 posts views Thread by Jay-nospam | last post: by
reply views Thread by roni schuetz | last post: by
44 posts views Thread by Smokey Grindle | last post: by
4 posts views Thread by Oriane | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.