473,811 Members | 2,717 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Preventing ASP.NET Application From Starting

Is there some way - perhaps in Application_Sta rt - that I can prevent an
ASP.NET (3.5) application from starting.

I would like to perform some environment validation and pipeline
configuration during Application_Sta rt - and if those efforts, themselves,
fail or have some runtime exception, then I want for the application to not
start (i.e., the Web site should not be available unless all of the startup
tasks complete without errors).

How can I accomplish this?

Thanks!

Jun 27 '08 #1
2 1160
I know of no way you can make the entire application not available, but you
should be able to set a value that tells you something is wrong and then use
a base class for every page the person should not hit. I would still leave
the default page available and give a friendly error message to the user.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************** *************** *************** ****
| Think outside the box!
|
*************** *************** *************** ****
"Cramer" <A@B.comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Is there some way - perhaps in Application_Sta rt - that I can prevent an
ASP.NET (3.5) application from starting.

I would like to perform some environment validation and pipeline
configuration during Application_Sta rt - and if those efforts, themselves,
fail or have some runtime exception, then I want for the application to
not start (i.e., the Web site should not be available unless all of the
startup tasks complete without errors).

How can I accomplish this?

Thanks!


Jun 27 '08 #2
Since the OP, I thought about the option to use the app_offline.htm
technique described here:
http://weblogs.asp.net/scottgu/archi...06/426755.aspx

Apparently I could - upon detecting that the runtime conditions necessitate
making the entire system unavailable, programmaticall y copy app_offline.htm
to the root folder. While this would apparently make ASP.NET completely
unavailable - which is the intended goal - it would also/therefore mean that
I could not use ASP.NET to remove app_offline.htm from the root folder of
the site. So this technique, while quite effective and simplistic (which is
good!) would also mean that it should be reserved for the most serious of
error conditions that would necessitate a system administrator to be
manually fixing stuff on the Web server... and the last thing the system
administrator would do is manually remove app_offline.htm to make the entire
site once again available.

-Cramer
"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamMwrote in
message news:uv******** *****@TK2MSFTNG P02.phx.gbl...
>I know of no way you can make the entire application not available, but you
should be able to set a value that tells you something is wrong and then
use a base class for every page the person should not hit. I would still
leave the default page available and give a friendly error message to the
user.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************** *************** *************** ****
| Think outside the box! |
*************** *************** *************** ****
"Cramer" <A@B.comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>Is there some way - perhaps in Application_Sta rt - that I can prevent an
ASP.NET (3.5) application from starting.

I would like to perform some environment validation and pipeline
configuratio n during Application_Sta rt - and if those efforts,
themselves, fail or have some runtime exception, then I want for the
application to not start (i.e., the Web site should not be available
unless all of the startup tasks complete without errors).

How can I accomplish this?

Thanks!





Jun 27 '08 #3

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

Similar topics

12
2956
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am starting is that it has a welcome window first which gets displayed and then the real windows after a while,in other words it means that the process name is the same, but the handle I need to retrive is the one from the final window and not the...
2
2023
by: johnmann56 | last post by:
Hello. I have written a simple image viewer application using C# .NET. It only needs to display one image at a time. When a different program, in C, running on the same machine, does a "system(myfile.a2d2)" call, it automatically starts my image viewer application (using file type association). a2d2 is the image file format, my own. If the C program does the system call again for a different image, I find that it starts a new instance of...
8
2471
by: alanstew | last post by:
With the body tag calling out 'window onload', a function with a 'window.open' fails at the 'window.open' line. If I cut out the body tag, the function executes as normal. At first I thought it was the entire function failing, but I tested with alerts and found that it was only the 'window.open' that fails to execute. The function is being called by a link, and I suspected some problem with the body alink/vlink but after cutting that out...
6
1495
by: Dennis C. Drumm | last post by:
Is there a way to set the security for a .net application so that it can only be run on the machine were it is installed? I would like to prevent users from being able to start the application by navigating to a shared drive on the computer where the program was installed and starting it using the shortcut or exe installed on the host computer. thanks, Dennis
1
2453
by: whitehorse | last post by:
When the warehousecontroller service is invoked, the following error message is sent to the application log: Event Type: Error Event Source: TFS Warehouse Event Category: None Event ID: 3000 Date: 4/14/2006 Time: 2:41:08 PM User: N/A
7
4272
by: Mark | last post by:
It is possible from a .NET application to prevent Windows from shutting down? I understand that a .NET application can "know" that windows is initiating the process of to shutting down - but what about *preventing* that shutdown? (and yes - I know the user can always unplug the machine) Thanks.
3
3286
by: Bill Davidson | last post by:
All: I have a problem in which a worker thread in my (.dll) assembly isn't allowing the main (.exe) assembly from terminating. Here's the scenario: 1) App.Exe is launched. 2) App.Exe calls into my .dll (Sub.Dll)
2
1304
by: giddy | last post by:
hi, I've heard its possible!? Is it? : preventing an application from running over a network. Or it would even be great if i could know if someone from a networked computer tried to run my program!?? Thanks Gideon
5
7874
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based setting is of course stored in the app.exe.config file located in the same directory as the exe. Upon closing the form, I save the user setting which then creates a user.config file in the appdata directory in my profile. This is all well and good....
0
9605
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,...
0
10648
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10135
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...
0
9205
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
5554
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
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
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
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.