473,785 Members | 2,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3380
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(Glo bal
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.Http Application
{

protected void Application_Sta rt(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...@newsgro up.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_St art" 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
23084
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated to a pool. If I assign only one application to a applicaton pool and have multiple worker processes assigned to that pool. Will my application be processed by many worker processes?
2
2100
by: Lars Netzel | last post by:
Hi We have an ASP.NET application running on a Live server and we have had some problems with the Application pool beeing recycled due to heavy load on the server. The load is really not that bad and this should nto occur. The application is using a lot of Session varaibles but I have no idea if this is a problem. I need the session variabled to make passing varibles between pages more secure. We also have many Datasets in the session. ...
3
3875
by: Diffident | last post by:
Hi All, We are running a web application that we suspect has a bad code which is causing it to consume lots of memory and CPU cycles. We have set the application pool recycle parameters to CPU 50 and also virtual memory 250,000K but the app pool does not seem to be restarted automatically. Everytime we are forced to restart the pool manually by killing the process.
3
2622
by: Jay-nospam | last post by:
Hi there, I am having trouble getting an ASP.NET web application to connect to another computer and passing the proper credentials and I hope someone can help me. I have a stand-alone Windows 2003 Server, ServerA, running as a Web Server that uses ASP.NET. The default.aspx file tries to access a file in a share on another computer, ServerB. ServerA and ServerB are on the same domain and are both running Windows 2003 Server.
6
15742
by: M Craig | last post by:
I'm trying to write a custom installation engine to plug into our existing build system. Some things I'm trying to do are, Create/Delete/Start/Stop Application Pools, Web Sites, and Virtual Directories. At this point I'd be happy if someone can provide a sample of how to Stop an application pool. Or point me in the right direction. Thanks!
0
1668
by: roni schuetz | last post by:
since a few day's i'm running around the problem that I stocked with a change i need to do. hopefully somebody here can give me a tipp which will be usefull to solve my problem. I'm using a thread-pool within my WebSite which done some requests to several interfaces the readed data will be added to the cache. This operations consumes much CPU and I want to have this outside my website so i decided to change the flow. It should looks...
44
8274
by: Smokey Grindle | last post by:
I have a list box on my form, but I need to databind it to a data table that is a private member of the form's class... so I basically have Public Class MyForm priate m_MyTable as new datatable End Class now where would I properly dispose of this? In the finalize method? I am loading the data for the table in a subroutine that is executed at form load, of course all the commands tied to it are wrapped in using blocks, but
4
1592
by: Oriane | last post by:
Hello, I will soon installed a small Ajax Asp.Net "single page" site on a client site. This page is simply polling a Asp.Net Web service, which fetchs and returns parameters (temperature, air conditioning status...) to be displayed on the page. This is implemented with an Ajax Timer control server. Now this is my first "industrial" web site, and I'm concerned about its robustness. Do I need to create a specific pool on IIS 6 for the...
1
6547
by: kungfule | last post by:
I have a website that run on Window Server 2003, IIS 6. The problem is when I browse my website then Application Pool is stopped.!? I dont know why. Then I run ISS, start my application pool and browse my web site, it show error: Service Unavailable. Then I open ISS and see Application Pool is stopped!? That's strange! Please help me Thanks, Hoang Le
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4063
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.