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

Home Posts Topics Members FAQ

prevent application shutdown

Is there a way to prevent my web application from shuting down if I
don't have access to machine.config?
Thanks,
Pint
Nov 19 '05 #1
5 2567
If you don't have access to machine.config then this tells me you don't own
the machine (so perhaps you're on a hosted box?). So if you don't own the
machine, then no, there's no way to prevent an admin or anyone else from
walking up to your app and shutting it down.

I suspect the real problem you're having is that the application is getting
automatically recycled. This is a fact of life in ASP.NET and you have to
code to that behavior. There have been a few other threads here recently
on the subject.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Is there a way to prevent my web application from shuting down if I
don't have access to machine.config?
Thanks,
Pint


Nov 19 '05 #2
Does someone know how to prevent application shutdown? Or can you refer
me to the threads that Brock speaks of.
Thanks,
Pint

Brock Allen wrote:
If you don't have access to machine.config then this tells me you don't
own the machine (so perhaps you're on a hosted box?). So if you don't
own the machine, then no, there's no way to prevent an admin or anyone
else from walking up to your app and shutting it down.

I suspect the real problem you're having is that the application is
getting automatically recycled. This is a fact of life in ASP.NET and
you have to code to that behavior. There have been a few other threads
here recently on the subject.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Is there a way to prevent my web application from shuting down if I
don't have access to machine.config?
Thanks,
Pint


Nov 19 '05 #3
On Wed, 16 Mar 2005 16:30:12 GMT, Pint <pi******@fpoin t.net> wrote:
Does someone know how to prevent application shutdown?
You can't prevent the system from taking an application down.
Or can you refer
me to the threads that Brock speaks of.


http://groups-beta.google.com/groups...&lr=&c2coff=1&

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #4
My bad. I will try to more specific when asking this question again. I
already know about google, and already searched for my answer. I found
lots of references there suggesting I also search google. Hmmmm? I
wonder if directing someone to use google when answering a newsgroup
post dilutes the value of google groups.

I have an aspnet application in a hosted environment. My application
spawns threads that do work in the background. That is to say these
threads do not have HttpContext. I keep handles to these threads by
storing them in my Application object.

I do not understand how the application decides to recycle itself. I
would like to keep these threads alive independent of the frequency of
Request to the web server.

It seems a likly hack is to place a webrequest in a timer. It seems
there should be a cleaner way to do this.

Thanks,
Pint

Scott Allen wrote:
On Wed, 16 Mar 2005 16:30:12 GMT, Pint <pi******@fpoin t.net> wrote:

Does someone know how to prevent application shutdown?

You can't prevent the system from taking an application down.

Or can you refer
me to the threads that Brock speaks of.

http://groups-beta.google.com/groups...&lr=&c2coff=1&

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/

Nov 19 '05 #5
Ah, now some specifics... good :)
I do not understand how the application decides to recycle itself. I
would like to keep these threads alive independent of the frequency of
Request to the web server.
Well, when you create managed threads they're scoped to the AppDomain which
is like a process. The AppDomain in ASP.NET essentially maps to the virtual
directory, meaning all page objects, etc for that vdir live in the AppDomain.
The AppDomain settings are initialized from web.config. So, what causes an
AppDomain to get restarted? Well, changes to web.config for one. Also, based
upon machine.config or IIS configuration, the AppDomain can get restarted
based upon the number of requests to the app, the time the app has been running
and many other things...
I have an aspnet application in a hosted environment. My application
spawns threads that do work in the background. That is to say these
threads do not have HttpContext. I keep handles to these threads by
storing them in my Application object.


So this is cool, it's just that you need to manage this appropriately. I'd
suggest not using the Application object to store this data. Instead use
static (C#) or Shared (VB.NET) data structures to store this data. It's essentially
the same and you don't rely upon a HttpContext for the storage. The big thing
is to clean up these resources when the AppDomain is shutting down. You can
handle the AppDomain.Domai nUnload event. Very much the same idea as Application_End ,
but again it's not tied to the ASP.NET plumbing. This is where you can do
the cleanup of those handles that you're storeing in static variables.

HTH (and it's 100% google free :P)

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7025
by: Madhava Patro | last post by:
Hi All, I have a requirement where i have to Shutdown Windows 2000 from a C# Application, my application is running as windows service. When I shutdown Windows it should not reboot again, It should power down.
3
3481
by: kuldeep | last post by:
Hi all, I have a application developed in C# .net. The problem I face is I am unable to shutdown my machine when the exe is running. Windows is unable to close this exe an shut down. Can anyone help. Regards, Kuldeep Pawar
0
1473
by: Dan Baker | last post by:
I have an application that runs in the background, with a NotificationTray icon for access to the UI. I'm handling the "ENDSESSION" event, and trying to force my application to shutdown. I'm calling "Application.Exit()" to shutdown the application. I've noticed that if the application UI is displayed, and a simple Yes/No "MessageBox" is displayed, that the Application.Exit() won't work -- it does nothing.
7
7901
by: Nikki | last post by:
Hi, Can anybody help me, i want to prevent windows to close my winform of ..NET application, when user presses Alt+F4
2
4590
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET Here's the scenario: 1. .NET Windows Client on a remote machine makes a web service call to update tables on a Web Server running SQL Server 2000. 2. The Update is updating about 1000 - 3000 records doing simple update statements like "Update...
3
3237
by: rdemyan via AccessMonster.com | last post by:
I have a forced logoff routine in place that works well unless an Access messagebox is showing in the front-end that the routine is trying to shut down. It doesn't work use Access commands to shut down the application. Is there a way to use a Windows API to shutdown the application? I'm hoping that, like the task manager, a Windows API shutdown would work even if a modal form is displayed in the application it is trying to shutdown. ...
6
2044
by: Mad Scientist Jr | last post by:
My asp.net pages sessions are timing out after 20 minutes, and when I asked my Web host about it they said due to the nature of a shared hosting environment they cannot allow for sessions to keep application pools and worker processes hosed for too long as these fearures are consuming CPU resources while they are active. Therefore the pool application shutdown and re-start settings are at 20 minutes. Is there a workaround for this? Do I...
4
3409
by: Markus Stoeger | last post by:
Hi, I have a problem with Application.Run() when Windows is shutting down. Please have a look at the copy&paste example program below. The application has no forms. It has only got a notify icon in the system tray and it uses Application.Run() to keep the message loop running. When the user clicks the icon, the application should shut down and exit. So far that works fine.
1
5323
by: Clemente | last post by:
Hi, We have a VB.Net application that is sleeping until it receives a logoff/shutdown event. We want the application running on Vista and XP. When the application receives those events it has to show a message box, so the user can answer Yes or No, and then let the logoff/ shutdown process continues.
0
9645
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
9481
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
10095
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
8979
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
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...
1
4054
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
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
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.