Re: URGENT: Application_Start - doesn't fire

From: Gordon Smith (GS_at_NoSpam.net)
Date: 02/28/05


Date: Sun, 27 Feb 2005 21:47:31 -0800


<< you will need to attach a debugger to the worker process on the server to
find out exactly what is going on>>

Okay, how do I do that? I have VS.NET 2003, am accessing the Web server
across the Internet, and have full administrative access to the Web Server
(which is Windows Server 2003/IIS6, with all current patches/updates).

Since last post, I have a number of new observations but no solution. I
simply need more information *from the server itself* about what's going on.

The Web.config for the app in question includes these:
<customErrors mode="RemoteOnly" defaultRedirect="GenericError.htm" />
 (this is the page I keep getting in the client)

In an effort to get more info, I switched from this...
<customErrors mode="RemoteOnly" defaultRedirect="GenericError.htm" />

to this...
<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

But kept getting the error page telling me to change the entry in Web.config
to the latter (which I had in fact done). It behaves as if the application
did not restart - because it treated the <customErrors mode> setting as if
it were still <customErrors mode="RemoteOnly"
defaultRedirect="GenericError.htm" />

I also switched Web.config from this:
    <compilation
         defaultLanguage="c#"
         debug="false"
    />
to this:
    <compilation
         defaultLanguage="c#"
         debug="true"
    />

But the site behaves is as if the changes were never made (and yes, I saved
the changes to Web.config).

I had originally created the new Web site via a script -so I manually
created a brand new Web site on the server (and modified the host headers in
IIS so that the old URL would resolve to the new/test Web site) and copied
all of the files into it from the site having the problem this thread is all
about. The new site came up without an exception (and I got the e-mail sent
from Application_Start) - BUT ONLY the very first time I accessed the
application from a client. After the first time, I got the exceptions and
related behavior as described in my prevoius postings. It seems that no
matter what I do, the application will not restart. I have stopped and
restarted the Web Site, it's Application pool, (created a new App pool just
for this app), and even rebooted the server - but still no dice. I have
commented out all of my application_start logic, Session_start logic - but
still no change in behavior. It's as if the Web site simply ignores ANY
changes I make once the exception is encountered for the first time.

I'm pretty confused at this point. How can I get the Web server itself to
tell me more about the exception?

Thanks!

"Alvin Bruney [Microsoft MVP]" <www.lulu.com/owc> wrote in message
news:%23x0TMwSHFHA.3472@TK2MSFTNGP09.phx.gbl...
> in your application start handler, send an email to yourself
> using the system.web.mail functionality. run the app and see if you get an
> email.
>
> if you don't get an email, you will need to attach a debugger to the
> worker process on the server to find out exactly what is going on.
>
> --
> Regards
> Alvin Bruney
> [Shameless Author Plug]
> The Microsoft Office Web Components Black Book with .NET
> available at www.lulu.com/owc
> --------------------------------------------------
>
>
> "Gordon Smith" <GS@NoSpam.net> wrote in message
> news:OEJ638RHFHA.1096@tk2msftngp13.phx.gbl...
>> Thanks Alvin.
>>
>> A couple of things.
>> I have a version installed right now that has *all* of the
>> Application_Start and all of the Session_Start logic (just to ensure that
>> something wasn't interacting with the new/current Session) commented
>> out - thereby eliminating the possibility of logic problems, AFAIK.
>>
>> Since last post I have rebooted the server. Still no dice.
>>
>> << Nope, asp.net is not responsible for serving htm files by default.>>
>> Right... that's why I put an default.html file in. I thought that would
>> tell me if there was a problem with the Web site (independent of ASP.NET)
>> or if there was something going on with ASP.NET. So, unless I'm mistaken,
>> I think I have narrowed it down to "something with ASP.NET or with my
>> application logic" and not a problem with the Web site, itself or IIS -
>> because the default.html file was served just fine, but the simple
>> default.aspx was not.
>>
>> At this point I'm thinking about killing the site and recreating it from
>> scratch... but I hate to do that because even if the problem - whatever
>> it was - goes away, I don't have the opportunity to know what went wrong.
>>
>>
>> "Alvin Bruney [Microsoft MVP]" <www.lulu.com/owc> wrote in message
>> news:OMqIrwRHFHA.3156@TK2MSFTNGP10.phx.gbl...
>>> >So that tells me it's something about asp.net.
>>> Nope, asp.net is not responsible for serving htm files by default.
>>>
>>> Your application start is firing correctly because you can request a
>>> page. Your logic and steps you have taken does not indicate a problem
>>> with your application_start handler. Rather, the problem seems to be
>>> with the code that fires inside the application_start handler. Try
>>> re-writing with some error handling code first to see what gives.
>>>
>>>
>>> --
>>> Regards
>>> Alvin Bruney
>>> [Shameless Author Plug]
>>> The Microsoft Office Web Components Black Book with .NET
>>> available at www.lulu.com/owc
>>> --------------------------------------------------
>>>
>>>
>>> "Gordon Smith" <GS@NoSpam.net> wrote in message
>>> news:%23H76KFRHFHA.3912@TK2MSFTNGP10.phx.gbl...
>>>> One more observation:
>>>> When I have a simple default.htm - that page gets served just fine on
>>>> the first request. When I have a simple default.aspx - it chokes. So
>>>> that tells me it's something about asp.net.
>>>>
>>>> Still needing ideas here... thanks.
>>>>
>>>>
>>>> "Gordon Smith" <GS@NoSpam.net> wrote in message
>>>> news:%23mP1XRQHFHA.3612@TK2MSFTNGP09.phx.gbl...
>>>>>I have four (4) ASP.NET Web applications/Web sites on a IIS/6 - Windows
>>>>>Server 2003 production server. 3 of them work fine. I just installed
>>>>>the 4th one and it's Application_Start event is not firing.
>>>>>
>>>>> I have double-checked everything (and rechecked) and I haven't found
>>>>> anything that would explain why the Application is not starting.
>>>>>
>>>>> Here is what I have done so far to troubleshoot this:
>>>>>
>>>>> In IIS Manager I have ensured that there is a unique Application name
>>>>> in the Home Directory tab of the Properties for the Web site in
>>>>> question. I have verified that the home directory path is specified
>>>>> correctly. All other properties in IIS have identical values to the
>>>>> other sites that do work corectly (or have site-specific values that
>>>>> make sense). I have stopped and started the Web site via IIS Manager.
>>>>> I have verified correct content in Web.config (which is virtually
>>>>> identical to the other site's Web.config files). I have saved changes
>>>>> to Web.config in an effort to get the application to restart. I have
>>>>> recompiled and reinstalled the dll.
>>>>>
>>>>> I have verified that this particular Web app is in fact online and
>>>>> functioning to some extent. This particular Web application connects
>>>>> to a database (per settings in Web.config). I have verified that the
>>>>> application is, in fact, connecting to the database because I was able
>>>>> to log in (and the credentials are verified against a table in the
>>>>> database). Furthermore, the Web site will serve up pages. I put in a
>>>>> simple "hello world!" default.aspx which is served correctly. I also
>>>>> put in my standard default.aspx which hits the database (and verified
>>>>> that it hit the database when the page was requested). I will note
>>>>> that whenever *any* page is first requested that I get a general HTTP
>>>>> exception - but on the second request the page is served as expected.
>>>>> So, this Web site is online and "mostly" available. The whole problem
>>>>> is that Application_Start does not fire - which is a big problem
>>>>> because that's when I load important variables into the Application
>>>>> state.
>>>>>
>>>>> FWIW: Toward fixing this I created a new application pool via IIS
>>>>> Manager and placed the Web application into it (and stopped/restarted
>>>>> the Web site)... still no dice.
>>>>>
>>>>> Any ideas for troubleshooting this? I really need Application_Start to
>>>>> fire.
>>>>>
>>>>>
>>>>> Thanks!
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Relevant Pages

  • Re: URGENT: Application_Start - doesnt fire
    ... It's as if the Web site simply ignores ANY ... > changes I make once the exception is encountered for the first time. ... You never said what the exception was. ... How can I get the Web server itself to ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Cant see performance report, etc. SBS2003
    ... However, for "OpenSSH Server", you need to ensure it started, or set ... click to check the "Hide All Microsoft Services" ... Make sure no host header is assigned to the Default Web Site. ... Reinstall Monitoring component: ...
    (microsoft.public.windows.server.sbs)
  • Re: RPC over HTTPS fails following install of SharePoint Services
    ... I am also switching to a new server and on the new server I ... 80 so they get through firewalls OK but only the default web site has SSL ... and on the extra web site I am now running the sharepoint service and for now ... An unhandled exception has occurred. ...
    (microsoft.public.exchange.admin)
  • Re: HELP PLEASE - need app to modify multiple MDB table designs simultaneously
    ... ONE database runs ONE application and EACH ... application runs only ONE web site and it work great this way. ... particular app, it would not be efficient to have ONE application run ALL ... web sites on my server. ...
    (microsoft.public.access.replication)
  • Re: HELP PLEASE - need app to modify multiple MDB table designs simultaneously
    ... ONE database runs ONE application and EACH ... application runs only ONE web site and it work great this way. ... particular app, it would not be efficient to have ONE application run ALL ... web sites on my server. ...
    (microsoft.public.vb.com)