application-start

How can you hook a SharePoint 2007 feature into the Application_Start of a site?

Hello, I was wondering if there is a good way to hook into the Application_Start of a SharePoint 2007 site when developing a feature? I know I can directly edit the Global.asax file in the site root, but is there a way to do this so that it gets deployed with the feature? Thanks! ...

Application_Start works fine on workstation, is not called when deployed

I have an application that works great on my development workstation but fails when the application is deployed to the live environment. It seems that Application_Start is not being called in the live environment. ...

Stop execution of ASP.NET application

In my Application_Start() method, how can I stop the execution of the ASP.NET application when certain conditions are not met? Throwing an exception doesn't appear to work. ...

Why does Application_Start run in Cassini but not in IIS7?

I have an ASP.NET 3.5 sp1 app that's in development in Cassini. The app includes a global.asax file that should run some code - it works fine in Cassini but in IIS the debugger never hits the function. Why doesn't that code run? ...

How can I use Server.MapPath() from global.asax?

I need to use Server.MapPath() to combine some files path that I store in the web.config. However, since Server.MapPath() relies on the current HttpContext (I think), I am unable to do this. When trying to use the method, even though its "available", I get the following exception: "Server operation is not available in this context." ...

log4net Configuration for console app.

can anyone suggest how to configure the log4net for an console app? Or at least how/where to catch the Application_Start event? (It seams that some calls are required at this moment) Thanks in advance! ...

get keydown on application/form load in vb.net

I want to able to hold a key down while the application is loading and depending on which is being held down a certain form is shown. For example holding down shift and the opening itunes opens a little dialog allowing you set the library(or something) I can check whether the shift/Ctrl/Alt are being held down but i'd prefer to use the...

Does Application_Start block all incoming requests

Hi I have some code that initializes a static singleton class, which is needed by all requests. Therefore I thought I could add it to global.asax Application_Start. Can I be 100% sure that all requests will block while Application_Start is loading to guarantee that all the requests will have access to it? Thanks a lot Jeeji ...

How to start up your .NET program from web browser?

Could you provide example of JavaScript function for starting up application installed on your computer from a web browser (eg google chrome 4). It particular if .Net APPs have any special simplifying this process apis of out there are some libs for such staff, please share link with us. so how to create and store in run on start up p...

How to detect that the application start failed?

Our Situation: We have several webservers behind a loabalancer (Astaro Security Gateway). On the webservers we run an asp.net application and we have customerrorpages configured for 404 and 500 status codes. Now when the Application fails to start every request is redirected to the errorpage by sending status code 302 and the errorpage...

Intermittant exception in Application_Start - how do I un-start the application?

In our Application_Start event handler we're performing some actions that intermittently fail due to file locking issues. In this scenario we would like to return the application to an "un-started" state. By this I mean that the user will be shown an error page, and then the next time a user hits the site the Application_Start event wil...

Why would IIS "start" an App that is still running?

We have an ASP.NET (3.5 SP1) application running on IIS7 / Windows 2008. We trap Application_Start and Application_End events in Global.asax. We also host WCF services in the app and trap the OnOpening and OnClosing events via a ServiceHostFactory. Thus, we thought, we are guaranteed notification of any application start and stop, sch...

Multiple Application_Start events firing

I am debugging an ASP.NET 2.0 application that is suffering from slow loading of the initial page. Through adding logging, I've found that the Application_Start event fires twice on startup with a short delay between the two events. The Session_Start event also fires twice, with the same Session ID value. e.g. [Header] 2010-09-10 14:...

Application_Start not called in global.asax. Why?

In my global.asax I have the following code: public static bool Was = false; protected void Application_Start(object sender, EventArgs e) { Was = true; } When I open a page and look at the Was variable, it's still false. What gives? (Note: the variable isn't used anywhere else, I made it just for this test case) Update: I just f...

Roles lost after being set in Global.asax Application_Start()

Hi, In the master page for my site, i have added several LoginView controls that use roles to determine if menu items should be displayed to the logged in user. In my Global.asax Application_Start() event i am adding roles for a set of users as defined in my Web.Config file (as additions to those already in Active Directory) - Like so:...

What is the best way to force an Application Start when an Application Pool is recycled?

I'm wondering if there is a way to automagically fire off an Application Start for a web site/application whenever the Application Pool for that site is recycled? Are there any canned solutions for this problem? I would really like to avoid having one of my end users have to go through the application start of the site if they can avoi...

What code whould be placed in the application_start and the session_start events in global.asax?

Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines? I know when each subroutine is called. Application_Start when the first user first accesses the web application. Session_Start when a user opens a session with the application. But what code belongs in each of these subr...