Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET C#4.0
Hi,
 
I need to shut down my web application during maintenance process, have already gone through many ways like putting app_offline.htm in root directory , disabling the Runtime or disabling it manually via server but i what i need to implement is to do this process completely automated.
 
What i have is the start and end dates for shut down and flag for those days i.e whether application needed to be shut down on those dates.
 
Solution that i already have is to create a job in sql server agent which creates and deletes the app_offline.htm file in and from the root directory but what the problem is i need to give static path for the root directory of my application which i don not want to do.
 
Any help would be much appreciated.
Posted 4-Jun-13 10:20am
Comments
Sergey Alexandrovich Kryukov at 4-Jun-13 15:33pm
   
Maybe an interesting question, but... Did you think about keeping consistency on atomic level? It would allow just to kill the service at anytime without much harm.
—SA
Ariana Bond at 4-Jun-13 15:37pm
   
This comment of yours is worthless without an answer.
richcb at 4-Jun-13 15:40pm
   
You will not last long here if you speak to people this way. Consider this a warning.
Ariana Bond at 4-Jun-13 15:41pm
   
Thanks for the warning...
Sergey Alexandrovich Kryukov at 4-Jun-13 15:53pm
   
This is just the opinion of the OP. No need to make a big deal out of it.
—SA
Ariana Bond at 4-Jun-13 15:45pm
   
Thank you SA...
Sergey Alexandrovich Kryukov at 4-Jun-13 15:52pm
   
Sure.
—SA
Sergey Alexandrovich Kryukov at 4-Jun-13 15:46pm
   
It's up to you how you use my comment. If you simply told me what you want me to do, I would think about posting an answer. For example, do you need a clarification? Or don't understand it? Or would need some detail? Or think that my idea is wrong? You are welcome to discuss it if you want.
 
To get help, you need to be more collaborative, I think so. Not a problem at all though...
 
—SA
Ariana Bond at 4-Jun-13 15:49pm
   
Was quite frustrated with this topic that is why misbehaved with you. And i am truly sorry for that.
Sergey Alexandrovich Kryukov at 4-Jun-13 15:54pm
   
Thank you for this note. Really, no problem. We're good.
—SA
Zoltán Zörgő at 4-Jun-13 15:41pm
   
Sergey's suggestion is usable, but not all application logic let you do that.
I would address in two steps:
1) Pre-maintanance phase: allow continuation of open sessions, but disallow new sessions. Plus a warning for the online users about application shutdown. You still need asp.net to run and you need some modification in your code.
2) After all sessions are closed or a grace period expires, you can shut down web application gracefully via the management interfaces.
Ariana Bond at 4-Jun-13 15:42pm
   
This is appreciable.
Sergey Alexandrovich Kryukov at 4-Jun-13 15:50pm
   
I agree. That's why my comment was in the "Did you think about...?" form.
 
This is exactly the point: this is the architectural-level decision which should depend on main functionality of the Web site (not the other way around, of course). Your scheme is quite a valid one for some other cases, more complicated. And my variant would probably be one of the simplest...
 
—SA
artefakt94 at 10-Jun-13 10:38am
   
Hello,
You can create a base page class with a function which manage this maintenance mode.
In this base class, you can get the current date and check in database if the app must be forced in maintenance mode. If so, you can redirect to a maintenance page you have developed.
Then, you add pages of your website that inherit this base class.
I think you can do the job with this ;)
Don't hesitate if you need additional explanations or help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 250
1 George Jonsson 175
2 Jochen Arndt 150
3 Kornfeld Eliyahu Peter 149
4 PIEBALDconsult 110
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 4 Jun 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100