global.aspx Application_error does not fire on anything other than
global.aspx Application_error does not fire on anything other than
am 14.01.2008 22:10:03 von jvcoach23
I've got a global.aspx file that works in my dev environment (vs 2005).
When i publish the site to a windows 2000 sp4 box running IIS, the global
does not seem to fire. Since it's a test server, i've tried granting the
user that IIS is using with all kinds of rights, that didn't work.... so is
there some setting i'm missing somewhere.
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when an unhandled error occurs
Dim olog As New dempsey.TextFile
With olog
.FileName = "500Errors.txt"
..SaveText("------------------------------------------------ -------------")
Dim err As Exception = Server.GetLastError()
.SaveText(Err.ToString)
.SaveText(err.StackTrace)
End With
Response.Redirect("~/500Error.htm")
end sub
and an bit from the web.config file
hope someone can help out...
just to be more complete.. in the appliction_error, i'm also writing some
info out to a sql database... again.. that works running things out of visual
studio.. but not when the code is published..
thanks
shannon
RE: global.aspx Application_error does not fire on anything other than
am 14.01.2008 22:17:04 von pbromberg
try using
Server.GetLastError().GetBaseException()
That's where all the information is.
Then call Server.ClearError()
before you redirect.
Are you getting an exeption when the call to the Database is made? It's
another possibility that could be blowing everything up on you.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"jvcoach23" wrote:
> I've got a global.aspx file that works in my dev environment (vs 2005).
> When i publish the site to a windows 2000 sp4 box running IIS, the global
> does not seem to fire. Since it's a test server, i've tried granting the
> user that IIS is using with all kinds of rights, that didn't work.... so is
> there some setting i'm missing somewhere.
>
> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
> ' Code that runs when an unhandled error occurs
> Dim olog As New dempsey.TextFile
> With olog
> .FileName = "500Errors.txt"
>
> .SaveText("------------------------------------------------- ------------")
> Dim err As Exception = Server.GetLastError()
>
> .SaveText(Err.ToString)
> .SaveText(err.StackTrace)
> End With
>
> Response.Redirect("~/500Error.htm")
> end sub
>
> and an bit from the web.config file
>
>
> hope someone can help out...
> just to be more complete.. in the appliction_error, i'm also writing some
> info out to a sql database... again.. that works running things out of visual
> studio.. but not when the code is published..
>
> thanks
> shannon
RE: global.aspx Application_error does not fire on anything other
am 14.01.2008 22:24:01 von jvcoach23
I'll try that..
I don't think the sql logging is causing any problems. I'm using a class to
write to the database, this class is using the same connection string that
all the other database calls are using and i'm able to do inserts for those.
i've watched in sql profiler and the sql box is not getting hit by the this
call... so i don't think it's firing... i understand though that if it was
getting chocked up on this, that it would make the call.. i've also tried
writing out to a log file, again, that works when running in visual studio,
but not when it is published.
"Peter Bromberg [C# MVP]" wrote:
> try using
>
> Server.GetLastError().GetBaseException()
>
> That's where all the information is.
> Then call Server.ClearError()
> before you redirect.
>
> Are you getting an exeption when the call to the Database is made? It's
> another possibility that could be blowing everything up on you.
>
> -- Peter
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> MetaFinder: http://www.blogmetafinder.com
>
>
> "jvcoach23" wrote:
>
> > I've got a global.aspx file that works in my dev environment (vs 2005).
> > When i publish the site to a windows 2000 sp4 box running IIS, the global
> > does not seem to fire. Since it's a test server, i've tried granting the
> > user that IIS is using with all kinds of rights, that didn't work.... so is
> > there some setting i'm missing somewhere.
> >
> > Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
> > ' Code that runs when an unhandled error occurs
> > Dim olog As New dempsey.TextFile
> > With olog
> > .FileName = "500Errors.txt"
> >
> > .SaveText("------------------------------------------------- ------------")
> > Dim err As Exception = Server.GetLastError()
> >
> > .SaveText(Err.ToString)
> > .SaveText(err.StackTrace)
> > End With
> >
> > Response.Redirect("~/500Error.htm")
> > end sub
> >
> > and an bit from the web.config file
> >
> >
> > hope someone can help out...
> > just to be more complete.. in the appliction_error, i'm also writing some
> > info out to a sql database... again.. that works running things out of visual
> > studio.. but not when the code is published..
> >
> > thanks
> > shannon
Re: global.aspx Application_error does not fire on anything other than
am 14.01.2008 23:27:43 von Shannon
Hi Peter.. another question
what is a way that i can test.. or trap if there is something causing the
application_error to bomb.. i mean.. if i have something wrong with my code
or something else is going wrong, what is the best way to figure that out...
if the application_error is running, but i'm bombing out on some of my
code.. what is somethign that i can put in there to test to see if it's
running. i'll commit out all my code
hopefully that way i can give you better info so you can set me straight..
thanks
shannon
"Peter Bromberg [C# MVP]" wrote in message
news:BCA4BB05-849D-4E82-BB8F-7F957395BA40@microsoft.com...
> try using
>
> Server.GetLastError().GetBaseException()
>
> That's where all the information is.
> Then call Server.ClearError()
> before you redirect.
>
> Are you getting an exeption when the call to the Database is made? It's
> another possibility that could be blowing everything up on you.
>
> -- Peter
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> MetaFinder: http://www.blogmetafinder.com
>
>
> "jvcoach23" wrote:
>
>> I've got a global.aspx file that works in my dev environment (vs 2005).
>> When i publish the site to a windows 2000 sp4 box running IIS, the global
>> does not seem to fire. Since it's a test server, i've tried granting the
>> user that IIS is using with all kinds of rights, that didn't work.... so
>> is
>> there some setting i'm missing somewhere.
>>
>> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
>> ' Code that runs when an unhandled error occurs
>> Dim olog As New dempsey.TextFile
>> With olog
>> .FileName = "500Errors.txt"
>>
>> .SaveText("------------------------------------------------- ------------")
>> Dim err As Exception = Server.GetLastError()
>>
>> .SaveText(Err.ToString)
>> .SaveText(err.StackTrace)
>> End With
>>
>> Response.Redirect("~/500Error.htm")
>> end sub
>>
>> and an bit from the web.config file
>>
>>
>> hope someone can help out...
>> just to be more complete.. in the appliction_error, i'm also writing some
>> info out to a sql database... again.. that works running things out of
>> visual
>> studio.. but not when the code is published..
>>
>> thanks
>> shannon
Re: global.aspx Application_error does not fire on anything other than
am 15.01.2008 00:53:06 von Jeff Dillon
Make sure the directory is marked at an IIS Application/virtual directory
Jeff
"jvcoach23" wrote in message
news:23940C55-C7BD-47E7-A7C5-5712E92DCB3A@microsoft.com...
> I've got a global.aspx file that works in my dev environment (vs 2005).
> When i publish the site to a windows 2000 sp4 box running IIS, the global
> does not seem to fire. Since it's a test server, i've tried granting the
> user that IIS is using with all kinds of rights, that didn't work.... so
> is
> there some setting i'm missing somewhere.
>
> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
> ' Code that runs when an unhandled error occurs
> Dim olog As New dempsey.TextFile
> With olog
> .FileName = "500Errors.txt"
>
> .SaveText("------------------------------------------------- ------------")
> Dim err As Exception = Server.GetLastError()
>
> .SaveText(Err.ToString)
> .SaveText(err.StackTrace)
> End With
>
> Response.Redirect("~/500Error.htm")
> end sub
>
> and an bit from the web.config file
>
>
> hope someone can help out...
> just to be more complete.. in the appliction_error, i'm also writing some
> info out to a sql database... again.. that works running things out of
> visual
> studio.. but not when the code is published..
>
> thanks
> shannon
Re: global.aspx Application_error does not fire on anything other than
am 15.01.2008 13:55:52 von Shannon
thanks for the comment.. it is..any other suggestions
"Jeff Dillon" wrote in message
news:e5$2ciwVIHA.1168@TK2MSFTNGP02.phx.gbl...
> Make sure the directory is marked at an IIS Application/virtual directory
>
> Jeff
> "jvcoach23" wrote in message
> news:23940C55-C7BD-47E7-A7C5-5712E92DCB3A@microsoft.com...
>> I've got a global.aspx file that works in my dev environment (vs 2005).
>> When i publish the site to a windows 2000 sp4 box running IIS, the global
>> does not seem to fire. Since it's a test server, i've tried granting the
>> user that IIS is using with all kinds of rights, that didn't work.... so
>> is
>> there some setting i'm missing somewhere.
>>
>> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
>> ' Code that runs when an unhandled error occurs
>> Dim olog As New dempsey.TextFile
>> With olog
>> .FileName = "500Errors.txt"
>>
>> .SaveText("------------------------------------------------- ------------")
>> Dim err As Exception = Server.GetLastError()
>>
>> .SaveText(Err.ToString)
>> .SaveText(err.StackTrace)
>> End With
>>
>> Response.Redirect("~/500Error.htm")
>> end sub
>>
>> and an bit from the web.config file
>>
>>
>> hope someone can help out...
>> just to be more complete.. in the appliction_error, i'm also writing some
>> info out to a sql database... again.. that works running things out of
>> visual
>> studio.. but not when the code is published..
>>
>> thanks
>> shannon
>
>
Re: global.aspx Application_error does not fire on anything other than
am 15.01.2008 15:42:27 von nomailreplies
re:
!> any other suggestions
1. Make sure the ASPNET account in the W2K server
( if you're not impersonating ASP.NET's account ),
which is the default account ASP.NET runs as under W2K,
has write permissions to the directory where 500Errors.txt is being written to.
If you don't know which account ASP.NET runs as in the W2K server,
save this code as "identity.aspx" and run it on the W2K server.
identity.aspx:
-------------------
<%@ Page Language="VB" %>
<%@ Import NameSpace = System.Security.Principal %>
What account is ASP.NET running as ?
------------
Whichever account that code returns is the account which needs permissions.
2. Make sure the account returned by identity.aspx has the
specific access permissions for the directories listed in this article:
ASP.NET Required Access Control Lists (ACLs)
http://msdn2.microsoft.com/en-us/library/kwzs111e.aspx
3. Register-unregister ASP.NET in IIS, by running aspnet_regiis
from a command window in the .Net Framework's 2.0 directory :
First unregister :
aspnet_regiis -u
Then, re-register :
aspnet_regiis -i
That will first delete and then recreate the ASP.NET account,
assigning the necessary permissions to that account.
I'd find it very strange if global.asax wouldn't fire,
if you have a healthy .Net Framework installation.
If none of these suggestions work, I'd uninstall the .Net Framework 2.0,
using the Add/Remove Programs applet in Control Panel...and reinstall it fully.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Shannon" wrote in message news:e%23XqmX3VIHA.536@TK2MSFTNGP06.phx.gbl...
> thanks for the comment.. it is..any other suggestions
>
> "Jeff Dillon" wrote in message news:e5$2ciwVIHA.1168@TK2MSFTNGP02.phx.gbl...
>> Make sure the directory is marked at an IIS Application/virtual directory
>>
>> Jeff
>> "jvcoach23" wrote in message
>> news:23940C55-C7BD-47E7-A7C5-5712E92DCB3A@microsoft.com...
>>> I've got a global.aspx file that works in my dev environment (vs 2005).
>>> When i publish the site to a windows 2000 sp4 box running IIS, the global
>>> does not seem to fire. Since it's a test server, i've tried granting the
>>> user that IIS is using with all kinds of rights, that didn't work.... so is
>>> there some setting i'm missing somewhere.
>>>
>>> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
>>> ' Code that runs when an unhandled error occurs
>>> Dim olog As New dempsey.TextFile
>>> With olog
>>> .FileName = "500Errors.txt"
>>>
>>> .SaveText("------------------------------------------------- ------------")
>>> Dim err As Exception = Server.GetLastError()
>>>
>>> .SaveText(Err.ToString)
>>> .SaveText(err.StackTrace)
>>> End With
>>>
>>> Response.Redirect("~/500Error.htm")
>>> end sub
>>>
>>> and an bit from the web.config file
>>>
>>>
>>> hope someone can help out...
>>> just to be more complete.. in the appliction_error, i'm also writing some
>>> info out to a sql database... again.. that works running things out of visual
>>> studio.. but not when the code is published..
>>>
>>> thanks
>>> shannon
>>
>>
>
>
Re: global.aspx Application_error does not fire on anything other than
am 15.01.2008 16:05:02 von Shannon
thanks...
i had seen that identity page tip somewhere else.. the account that the test
box is using is ASPNET and i added that user to the administrator group.. i
understand that i won't want to do that in production, but in an effort to
try to figure out what i'm doing wrong so that the global is not working, i
thought that should open the door pretty wide..
do you have any other suggestions
thanks
shannon
"Juan T. Llibre" wrote in message
news:e3vzaT4VIHA.4684@TK2MSFTNGP06.phx.gbl...
> re:
> !> any other suggestions
>
> 1. Make sure the ASPNET account in the W2K server
> ( if you're not impersonating ASP.NET's account ),
> which is the default account ASP.NET runs as under W2K,
> has write permissions to the directory where 500Errors.txt is being
> written to.
>
> If you don't know which account ASP.NET runs as in the W2K server,
> save this code as "identity.aspx" and run it on the W2K server.
>
> identity.aspx:
> -------------------
> <%@ Page Language="VB" %>
> <%@ Import NameSpace = System.Security.Principal %>
>
>
>
> What account is ASP.NET running as ?
>
>
>
>
>
> ------------
>
> Whichever account that code returns is the account which needs
> permissions.
>
> 2. Make sure the account returned by identity.aspx has the
> specific access permissions for the directories listed in this article:
>
> ASP.NET Required Access Control Lists (ACLs)
> http://msdn2.microsoft.com/en-us/library/kwzs111e.aspx
>
> 3. Register-unregister ASP.NET in IIS, by running aspnet_regiis
> from a command window in the .Net Framework's 2.0 directory :
>
> First unregister :
>
> aspnet_regiis -u
>
> Then, re-register :
>
> aspnet_regiis -i
>
> That will first delete and then recreate the ASP.NET account,
> assigning the necessary permissions to that account.
>
> I'd find it very strange if global.asax wouldn't fire,
> if you have a healthy .Net Framework installation.
>
> If none of these suggestions work, I'd uninstall the .Net Framework 2.0,
> using the Add/Remove Programs applet in Control Panel...and reinstall it
> fully.
>
>
>
> Juan T. Llibre, asp.net MVP
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en español : http://asp.net.do/foros/
> ======================================
> "Shannon" wrote in message
> news:e%23XqmX3VIHA.536@TK2MSFTNGP06.phx.gbl...
>> thanks for the comment.. it is..any other suggestions
>>
>> "Jeff Dillon" wrote in message
>> news:e5$2ciwVIHA.1168@TK2MSFTNGP02.phx.gbl...
>>> Make sure the directory is marked at an IIS Application/virtual
>>> directory
>>>
>>> Jeff
>>> "jvcoach23" wrote in message
>>> news:23940C55-C7BD-47E7-A7C5-5712E92DCB3A@microsoft.com...
>>>> I've got a global.aspx file that works in my dev environment (vs 2005).
>>>> When i publish the site to a windows 2000 sp4 box running IIS, the
>>>> global
>>>> does not seem to fire. Since it's a test server, i've tried granting
>>>> the
>>>> user that IIS is using with all kinds of rights, that didn't work....
>>>> so is
>>>> there some setting i'm missing somewhere.
>>>>
>>>> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
>>>> ' Code that runs when an unhandled error occurs
>>>> Dim olog As New dempsey.TextFile
>>>> With olog
>>>> .FileName = "500Errors.txt"
>>>>
>>>> .SaveText("------------------------------------------------- ------------")
>>>> Dim err As Exception = Server.GetLastError()
>>>>
>>>> .SaveText(Err.ToString)
>>>> .SaveText(err.StackTrace)
>>>> End With
>>>>
>>>> Response.Redirect("~/500Error.htm")
>>>> end sub
>>>>
>>>> and an bit from the web.config file
>>>>
>>>>
>>>> hope someone can help out...
>>>> just to be more complete.. in the appliction_error, i'm also writing
>>>> some
>>>> info out to a sql database... again.. that works running things out of
>>>> visual
>>>> studio.. but not when the code is published..
>>>>
>>>> thanks
>>>> shannon
>>>
>>>
>>
>>
>
>
Re: global.aspx Application_error does not fire on anything other than
am 15.01.2008 16:20:38 von nomailreplies
re:
!> i had seen that identity page tip somewhere else...
Probably somewhere where I posted...or where someone posted my code without attribution.
I wrote that ditty. :-)
re:
!> do you have any other suggestions
Run through the list of directories in the article link I posted,
and make sure the ASPNET account has the listed permissions.
As mentioned earlier, there's no reason for global.asax not to fire,
and for Application_Error not to fire, too, if you have a healthy install
of the .Net Framework and the .Net Framework is registered with IIS,
particularly if, as you say, the same code works in a test environment.
If none of the suggestions work, and unless the W2K server's admin
has explicitly forbidden the use of global.asax, uninstalling and reinstalling
the .Net Framework is the only recourse left.
Talk to the W2k server's admin...and see what (s)he says.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Shannon" wrote in message news:eBg3cf4VIHA.3832@TK2MSFTNGP06.phx.gbl...
> thanks...
> i had seen that identity page tip somewhere else.. the account that the test box is using is ASPNET and i added that
> user to the administrator group.. i understand that i won't want to do that in production, but in an effort to try to
> figure out what i'm doing wrong so that the global is not working, i thought that should open the door pretty wide..
>
> do you have any other suggestions
> thanks
> shannon
> "Juan T. Llibre" wrote in message news:e3vzaT4VIHA.4684@TK2MSFTNGP06.phx.gbl...
>> re:
>> !> any other suggestions
>>
>> 1. Make sure the ASPNET account in the W2K server
>> ( if you're not impersonating ASP.NET's account ),
>> which is the default account ASP.NET runs as under W2K,
>> has write permissions to the directory where 500Errors.txt is being written to.
>>
>> If you don't know which account ASP.NET runs as in the W2K server,
>> save this code as "identity.aspx" and run it on the W2K server.
>>
>> identity.aspx:
>> -------------------
>> <%@ Page Language="VB" %>
>> <%@ Import NameSpace = System.Security.Principal %>
>>
>>
>>
>> What account is ASP.NET running as ?
>>
>>
>>
>>
>>
>> ------------
>>
>> Whichever account that code returns is the account which needs permissions.
>>
>> 2. Make sure the account returned by identity.aspx has the
>> specific access permissions for the directories listed in this article:
>>
>> ASP.NET Required Access Control Lists (ACLs)
>> http://msdn2.microsoft.com/en-us/library/kwzs111e.aspx
>>
>> 3. Register-unregister ASP.NET in IIS, by running aspnet_regiis
>> from a command window in the .Net Framework's 2.0 directory :
>>
>> First unregister :
>>
>> aspnet_regiis -u
>>
>> Then, re-register :
>>
>> aspnet_regiis -i
>>
>> That will first delete and then recreate the ASP.NET account,
>> assigning the necessary permissions to that account.
>>
>> I'd find it very strange if global.asax wouldn't fire,
>> if you have a healthy .Net Framework installation.
>>
>> If none of these suggestions work, I'd uninstall the .Net Framework 2.0,
>> using the Add/Remove Programs applet in Control Panel...and reinstall it fully.
>>
>>
>>
>> Juan T. Llibre, asp.net MVP
>> asp.net faq : http://asp.net.do/faq/
>> foros de asp.net, en español : http://asp.net.do/foros/
>> ======================================
>> "Shannon" wrote in message news:e%23XqmX3VIHA.536@TK2MSFTNGP06.phx.gbl...
>>> thanks for the comment.. it is..any other suggestions
>>>
>>> "Jeff Dillon" wrote in message news:e5$2ciwVIHA.1168@TK2MSFTNGP02.phx.gbl...
>>>> Make sure the directory is marked at an IIS Application/virtual directory
>>>>
>>>> Jeff
>>>> "jvcoach23" wrote in message
>>>> news:23940C55-C7BD-47E7-A7C5-5712E92DCB3A@microsoft.com...
>>>>> I've got a global.aspx file that works in my dev environment (vs 2005).
>>>>> When i publish the site to a windows 2000 sp4 box running IIS, the global
>>>>> does not seem to fire. Since it's a test server, i've tried granting the
>>>>> user that IIS is using with all kinds of rights, that didn't work.... so is
>>>>> there some setting i'm missing somewhere.
>>>>>
>>>>> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
>>>>> ' Code that runs when an unhandled error occurs
>>>>> Dim olog As New dempsey.TextFile
>>>>> With olog
>>>>> .FileName = "500Errors.txt"
>>>>>
>>>>> .SaveText("------------------------------------------------- ------------")
>>>>> Dim err As Exception = Server.GetLastError()
>>>>>
>>>>> .SaveText(Err.ToString)
>>>>> .SaveText(err.StackTrace)
>>>>> End With
>>>>>
>>>>> Response.Redirect("~/500Error.htm")
>>>>> end sub
>>>>>
>>>>> and an bit from the web.config file
>>>>>
>>>>>
>>>>> hope someone can help out...
>>>>> just to be more complete.. in the appliction_error, i'm also writing some
>>>>> info out to a sql database... again.. that works running things out of visual
>>>>> studio.. but not when the code is published..
>>>>>
>>>>> thanks
>>>>> shannon
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: global.aspx Application_error does not fire on anything other than
am 15.01.2008 17:11:20 von Shannon
ok.. i'll get to work on that.. i'm the admin of the IIS box.. it's just a
test box that is running on it's own workgroup... I've got the 1.1 and 2.0
framework installed on the box...
I'll go through that link.. and post what happens...
thanks
"Juan T. Llibre" wrote in message
news:%23%23tAwo4VIHA.4740@TK2MSFTNGP02.phx.gbl...
> re:
> !> i had seen that identity page tip somewhere else...
>
> Probably somewhere where I posted...or where someone posted my code
> without attribution.
> I wrote that ditty. :-)
>
> re:
> !> do you have any other suggestions
>
> Run through the list of directories in the article link I posted,
> and make sure the ASPNET account has the listed permissions.
>
> As mentioned earlier, there's no reason for global.asax not to fire,
> and for Application_Error not to fire, too, if you have a healthy install
> of the .Net Framework and the .Net Framework is registered with IIS,
> particularly if, as you say, the same code works in a test environment.
>
> If none of the suggestions work, and unless the W2K server's admin
> has explicitly forbidden the use of global.asax, uninstalling and
> reinstalling
> the .Net Framework is the only recourse left.
>
> Talk to the W2k server's admin...and see what (s)he says.
>
>
>
> Juan T. Llibre, asp.net MVP
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en español : http://asp.net.do/foros/
> ======================================
> "Shannon" wrote in message
> news:eBg3cf4VIHA.3832@TK2MSFTNGP06.phx.gbl...
>> thanks...
>> i had seen that identity page tip somewhere else.. the account that the
>> test box is using is ASPNET and i added that user to the administrator
>> group.. i understand that i won't want to do that in production, but in
>> an effort to try to figure out what i'm doing wrong so that the global is
>> not working, i thought that should open the door pretty wide..
>>
>> do you have any other suggestions
>> thanks
>> shannon
>> "Juan T. Llibre" wrote in message
>> news:e3vzaT4VIHA.4684@TK2MSFTNGP06.phx.gbl...
>>> re:
>>> !> any other suggestions
>>>
>>> 1. Make sure the ASPNET account in the W2K server
>>> ( if you're not impersonating ASP.NET's account ),
>>> which is the default account ASP.NET runs as under W2K,
>>> has write permissions to the directory where 500Errors.txt is being
>>> written to.
>>>
>>> If you don't know which account ASP.NET runs as in the W2K server,
>>> save this code as "identity.aspx" and run it on the W2K server.
>>>
>>> identity.aspx:
>>> -------------------
>>> <%@ Page Language="VB" %>
>>> <%@ Import NameSpace = System.Security.Principal %>
>>>
>>>
>>>
>>> What account is ASP.NET running as ?
>>>
>>>
>>>
>>>
>>>
>>> ------------
>>>
>>> Whichever account that code returns is the account which needs
>>> permissions.
>>>
>>> 2. Make sure the account returned by identity.aspx has the
>>> specific access permissions for the directories listed in this article:
>>>
>>> ASP.NET Required Access Control Lists (ACLs)
>>> http://msdn2.microsoft.com/en-us/library/kwzs111e.aspx
>>>
>>> 3. Register-unregister ASP.NET in IIS, by running aspnet_regiis
>>> from a command window in the .Net Framework's 2.0 directory :
>>>
>>> First unregister :
>>>
>>> aspnet_regiis -u
>>>
>>> Then, re-register :
>>>
>>> aspnet_regiis -i
>>>
>>> That will first delete and then recreate the ASP.NET account,
>>> assigning the necessary permissions to that account.
>>>
>>> I'd find it very strange if global.asax wouldn't fire,
>>> if you have a healthy .Net Framework installation.
>>>
>>> If none of these suggestions work, I'd uninstall the .Net Framework 2.0,
>>> using the Add/Remove Programs applet in Control Panel...and reinstall it
>>> fully.
>>>
>>>
>>>
>>> Juan T. Llibre, asp.net MVP
>>> asp.net faq : http://asp.net.do/faq/
>>> foros de asp.net, en español : http://asp.net.do/foros/
>>> ======================================
>>> "Shannon" wrote in message
>>> news:e%23XqmX3VIHA.536@TK2MSFTNGP06.phx.gbl...
>>>> thanks for the comment.. it is..any other suggestions
>>>>
>>>> "Jeff Dillon" wrote in message
>>>> news:e5$2ciwVIHA.1168@TK2MSFTNGP02.phx.gbl...
>>>>> Make sure the directory is marked at an IIS Application/virtual
>>>>> directory
>>>>>
>>>>> Jeff
>>>>> "jvcoach23" wrote in message
>>>>> news:23940C55-C7BD-47E7-A7C5-5712E92DCB3A@microsoft.com...
>>>>>> I've got a global.aspx file that works in my dev environment (vs
>>>>>> 2005).
>>>>>> When i publish the site to a windows 2000 sp4 box running IIS, the
>>>>>> global
>>>>>> does not seem to fire. Since it's a test server, i've tried granting
>>>>>> the
>>>>>> user that IIS is using with all kinds of rights, that didn't work....
>>>>>> so is
>>>>>> there some setting i'm missing somewhere.
>>>>>>
>>>>>> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
>>>>>> ' Code that runs when an unhandled error occurs
>>>>>> Dim olog As New dempsey.TextFile
>>>>>> With olog
>>>>>> .FileName = "500Errors.txt"
>>>>>>
>>>>>> .SaveText("------------------------------------------------- ------------")
>>>>>> Dim err As Exception = Server.GetLastError()
>>>>>>
>>>>>> .SaveText(Err.ToString)
>>>>>> .SaveText(err.StackTrace)
>>>>>> End With
>>>>>>
>>>>>> Response.Redirect("~/500Error.htm")
>>>>>> end sub
>>>>>>
>>>>>> and an bit from the web.config file
>>>>>>
>>>>>>
>>>>>> hope someone can help out...
>>>>>> just to be more complete.. in the appliction_error, i'm also writing
>>>>>> some
>>>>>> info out to a sql database... again.. that works running things out
>>>>>> of visual
>>>>>> studio.. but not when the code is published..
>>>>>>
>>>>>> thanks
>>>>>> shannon
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 15:58:52 von jvcoach23
On Tue, 15 Jan 2008 10:11:20 -0600, Shannon wrote:
Well.. i checked the rights according to the article... the user that the
website is running under is ASPNET. that user has the rights that the
article describes... except for this line.. i'm not sure if about it
User profile directory
Used by the GAC cache lock files and the security configuration caching
mechanism of the common language runtime. If the user profile directory for
the account does not exist, ASP.NET uses the default user profile
directory.
i added the user with rigts to the the C:\Documents and Settings\SERVER1
dir (server1/aspnet is the user that shows up when i run the identity page)
so then i uninstalled .net 1.1 and 2.0... uninstalled iis.
reinstalled 1.1 and 2.0. then reinstalled iis
created the application in iis
published the website
had to run aspnet_regiis -i in the 2.0 framework and the website runs, but
the global still is not "working"
what kind of troubleshooting steps can i take to see if the global really
is working but what i'm asking it to do inside the application_error is
bombing, or if the global itself isn't working.
any suggestion would be great
thanks
shannon
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 16:09:55 von nomailreplies
Here's a simple test...
Include this in global.asax :
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Server.Transfer("Errors.aspx")
End Sub
Include this in "errors.aspx" :
errors.aspx:
-------------------
--------------
Finally, inside the system.web section of web.config, include this :
To test, write any invalid URL in the address bar...and see if you get the custom message.
That will tell you whether Global.asax, and Application_Error within it, are firing.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"jvcoach23" wrote in message news:gj73y512ymbu$.3hj258zeujo0.dlg@40tude.net...
> On Tue, 15 Jan 2008 10:11:20 -0600, Shannon wrote:
> Well.. i checked the rights according to the article... the user that the
> website is running under is ASPNET. that user has the rights that the
> article describes... except for this line.. i'm not sure if about it
>
> User profile directory
> Used by the GAC cache lock files and the security configuration caching
> mechanism of the common language runtime. If the user profile directory for
> the account does not exist, ASP.NET uses the default user profile
> directory.
>
> i added the user with rigts to the the C:\Documents and Settings\SERVER1
> dir (server1/aspnet is the user that shows up when i run the identity page)
>
> so then i uninstalled .net 1.1 and 2.0... uninstalled iis.
> reinstalled 1.1 and 2.0. then reinstalled iis
>
> created the application in iis
> published the website
> had to run aspnet_regiis -i in the 2.0 framework and the website runs, but
> the global still is not "working"
>
> what kind of troubleshooting steps can i take to see if the global really
> is working but what i'm asking it to do inside the application_error is
> bombing, or if the global itself isn't working.
>
> any suggestion would be great
> thanks
> shannon
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 17:15:57 von jvcoach23
i did as you suggested... added the code to the application_error and
commented out all my code that was in that sub
added the new page
modified the web.config file
when i hit the page that does not exists, i get a page "The page cannot be
found" error. i do not get redirected.
so after having checked the rights for the user, uninstalling and
reinstalling .net and IIS, what is the next step in the troubleshooting
list.
thanks again for all the pointers and help. Hope you can continue to help
me through this.
thanks
shannon
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 18:37:12 von nomailreplies
Try using the .aspx extension...
Look at the difference between :
http://asp.net.do/test/some.html
and
http://asp.net.do/test/some.aspx
If you want non-existent .html pages to be responded to with a custom page,
add the extension to the files processed by ASP.NET.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"jvcoach23" wrote in message news:di2vo1o5m12c$.plsdyvynhl5p.dlg@40tude.net...
>i did as you suggested... added the code to the application_error and
> commented out all my code that was in that sub
>
> added the new page
>
> modified the web.config file
>
> when i hit the page that does not exists, i get a page "The page cannot be
> found" error. i do not get redirected.
>
> so after having checked the rights for the user, uninstalling and
> reinstalling .net and IIS, what is the next step in the troubleshooting
> list.
>
> thanks again for all the pointers and help. Hope you can continue to help
> me through this.
>
> thanks
> shannon
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 18:45:56 von Scott Roberts
Another option is to simply set a custom page for 404 errors in IIS.
"Juan T. Llibre" wrote in message
news:eJh4uZGWIHA.4880@TK2MSFTNGP03.phx.gbl...
> Try using the .aspx extension...
>
> Look at the difference between :
>
> http://asp.net.do/test/some.html
> and
> http://asp.net.do/test/some.aspx
>
> If you want non-existent .html pages to be responded to with a custom
> page,
> add the extension to the files processed by ASP.NET.
>
>
>
> Juan T. Llibre, asp.net MVP
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en español : http://asp.net.do/foros/
> ======================================
> "jvcoach23" wrote in message
> news:di2vo1o5m12c$.plsdyvynhl5p.dlg@40tude.net...
>>i did as you suggested... added the code to the application_error and
>> commented out all my code that was in that sub
>>
>> added the new page
>>
>> modified the web.config file
>>
>> when i hit the page that does not exists, i get a page "The page cannot
>> be
>> found" error. i do not get redirected.
>>
>> so after having checked the rights for the user, uninstalling and
>> reinstalling .net and IIS, what is the next step in the troubleshooting
>> list.
>>
>> thanks again for all the pointers and help. Hope you can continue to
>> help
>> me through this.
>>
>> thanks
>> shannon
>
>
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 19:05:35 von nomailreplies
re:
!> Another option is to simply set a custom page for 404 errors in IIS.
404s for html, asp, etc. are handled "out of the box" by IIS,
without the need for a custom page for 404 errors, but .aspx files are not.
Remember, .aspx files go through the ASP.NET ISAPI application; html, asp, etc. files don't.
You're right, though, that is an option...for html files, for .asp files and,
in general, for any file that doesn't go through the ASP.NET ISAPI app.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Scott Roberts" wrote in message
news:O9IrkeGWIHA.4448@TK2MSFTNGP03.phx.gbl...
> Another option is to simply set a custom page for 404 errors in IIS.
> "Juan T. Llibre" wrote in message news:eJh4uZGWIHA.4880@TK2MSFTNGP03.phx.gbl...
>> Try using the .aspx extension...
>>
>> Look at the difference between :
>>
>> http://asp.net.do/test/some.html
>> and
>> http://asp.net.do/test/some.aspx
>>
>> If you want non-existent .html pages to be responded to with a custom page,
>> add the extension to the files processed by ASP.NET.
>>
>>
>>
>> Juan T. Llibre, asp.net MVP
>> asp.net faq : http://asp.net.do/faq/
>> foros de asp.net, en español : http://asp.net.do/foros/
>> ======================================
>> "jvcoach23" wrote in message news:di2vo1o5m12c$.plsdyvynhl5p.dlg@40tude.net...
>>>i did as you suggested... added the code to the application_error and
>>> commented out all my code that was in that sub
>>>
>>> added the new page
>>>
>>> modified the web.config file
>>>
>>> when i hit the page that does not exists, i get a page "The page cannot be
>>> found" error. i do not get redirected.
>>>
>>> so after having checked the rights for the user, uninstalling and
>>> reinstalling .net and IIS, what is the next step in the troubleshooting
>>> list.
>>>
>>> thanks again for all the pointers and help. Hope you can continue to help
>>> me through this.
>>>
>>> thanks
>>> shannon
>>
>>
>
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 19:05:36 von mark
"Scott Roberts" wrote in
message news:O9IrkeGWIHA.4448@TK2MSFTNGP03.phx.gbl...
> Another option is to simply set a custom page for 404 errors in IIS.
Not always an option with a public Internet site hosted with a 3rd-party
ISP...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 19:50:10 von jvcoach23
Here is the sub
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Server.Transfer("~/Errors.aspx")
'some commented out code
End Sub
and the name of the file it's going to is Errors.aspx.. all the code in the
files is as you had.
I've double checked, republished and i'm getting teh page cannot be found
message.. The redirect never takes place.
your code does redirect when i run it from vb.
again.. thanks for the help.. hope your willing to continue
thanks
shannon
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 19:51:20 von jvcoach23
yep.. i understand what your saying. but in the global.asax file, i have
some code to gather some info and store it to a database... that's why i am
trying to go this route..
thanks for the input though
shannon
On Wed, 16 Jan 2008 11:45:56 -0600, Scott Roberts wrote:
> Another option is to simply set a custom page for 404 errors in IIS.
>
>
> "Juan T. Llibre" wrote in message
> news:eJh4uZGWIHA.4880@TK2MSFTNGP03.phx.gbl...
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 20:50:11 von jvcoach23
ok.. the server.transfer seems to be working.. kind of.. need some
education here.
I loaded up sysinternals file monitor to see if i could better understand
if there was an access error. that is where i noticed that i was trying
to hit a file with an extension of aspx1... i put the 1 in my link to make
the file so that it was not found.. but after the post talking about the
html vs the aspx, i changed the dead link to be an aspx extension instead.
I republished and now i click on the dead link and the address bar shows
the dead link url, but the message on the screen is
The page you have requested can't be found.
We're sorry for the inconvenience.
from the page that i created per the advice of someone on this thread. so,
the server.transfer("~/Errors.aspx") verbage is showing up, but the url is
the dead link... does that sound correct.
i'm gonna put my code back in and keep on trying things.. just didn't want
someone running up the wrong tree trying to help guide me.. hoping somone
can still education me on the server.transfer and addresss line thing
mentioend above.
thanks
shannon
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 20:53:32 von jvcoach23
ahh.. the server.transfer is not happing at the client...if i were to do a
resposne.redirect, then that would actaully bring up the page url, cause
the client is the one issing the request... that more on track?
On Wed, 16 Jan 2008 13:50:11 -0600, jvcoach23 wrote:
> ok.. the server.transfer seems to be working.. kind of.. need some
> education here.
>
> I loaded up sysinternals file monitor to see if i could better understand
> if there was an access error. that is where i noticed that i was trying
> to hit a file with an extension of aspx1... i put the 1 in my link to make
> the file so that it was not found.. but after the post talking about the
> html vs the aspx, i changed the dead link to be an aspx extension instead.
>
> I republished and now i click on the dead link and the address bar shows
> the dead link url, but the message on the screen is
>
> The page you have requested can't be found.
> We're sorry for the inconvenience.
>
> from the page that i created per the advice of someone on this thread. so,
> the server.transfer("~/Errors.aspx") verbage is showing up, but the url is
> the dead link... does that sound correct.
>
> i'm gonna put my code back in and keep on trying things.. just didn't want
> someone running up the wrong tree trying to help guide me.. hoping somone
> can still education me on the server.transfer and addresss line thing
> mentioend above.
>
> thanks
> shannon
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 21:17:31 von nomailreplies
re:
!> I republished and now i click on the dead link and the address bar shows
!> the dead link url, but the message on the screen is
!> The page you have requested can't be found.
!> We're sorry for the inconvenience.
If that's the case, both global.asax and Application_Error are firing.
re:
!> but the url is the dead link... does that sound correct.
Yes. Server.Transfer preserves the original link.
Errors.aspx will *not* show up on the address bar.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"jvcoach23" wrote in message news:lzo7qkl0ej26$.xs0qrx4w98g5.dlg@40tude.net...
> ok.. the server.transfer seems to be working.. kind of.. need some
> education here.
>
> I loaded up sysinternals file monitor to see if i could better understand
> if there was an access error. that is where i noticed that i was trying
> to hit a file with an extension of aspx1... i put the 1 in my link to make
> the file so that it was not found.. but after the post talking about the
> html vs the aspx, i changed the dead link to be an aspx extension instead.
>
> I republished and now i click on the dead link and the address bar shows
> the dead link url, but the message on the screen is
>
> The page you have requested can't be found.
> We're sorry for the inconvenience.
>
> from the page that i created per the advice of someone on this thread. so,
> the server.transfer("~/Errors.aspx") verbage is showing up, but the url is
> the dead link... does that sound correct.
>
> i'm gonna put my code back in and keep on trying things.. just didn't want
> someone running up the wrong tree trying to help guide me.. hoping somone
> can still education me on the server.transfer and addresss line thing
> mentioend above.
>
> thanks
> shannon
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 21:21:29 von nomailreplies
Yes, but you'd lose the capability to capture the error messages.
Response.redirect doesn't let you do that.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"jvcoach23" wrote in message news:1ly4p4udd0py6.hpdokg0pod6x$.dlg@40tude.net...
> ahh.. the server.transfer is not happing at the client...if i were to do a
> resposne.redirect, then that would actaully bring up the page url, cause
> the client is the one issing the request... that more on track?
>
> On Wed, 16 Jan 2008 13:50:11 -0600, jvcoach23 wrote:
>
>> ok.. the server.transfer seems to be working.. kind of.. need some
>> education here.
>>
>> I loaded up sysinternals file monitor to see if i could better understand
>> if there was an access error. that is where i noticed that i was trying
>> to hit a file with an extension of aspx1... i put the 1 in my link to make
>> the file so that it was not found.. but after the post talking about the
>> html vs the aspx, i changed the dead link to be an aspx extension instead.
>>
>> I republished and now i click on the dead link and the address bar shows
>> the dead link url, but the message on the screen is
>>
>> The page you have requested can't be found.
>> We're sorry for the inconvenience.
>>
>> from the page that i created per the advice of someone on this thread. so,
>> the server.transfer("~/Errors.aspx") verbage is showing up, but the url is
>> the dead link... does that sound correct.
>>
>> i'm gonna put my code back in and keep on trying things.. just didn't want
>> someone running up the wrong tree trying to help guide me.. hoping somone
>> can still education me on the server.transfer and addresss line thing
>> mentioend above.
>>
>> thanks
>> shannon
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 21:24:28 von jvcoach23
so if you wnat to handle page not found links that are not aspx extensions,
like pdf files, then you need to use the customer error handling... cause
that won't go through the global... am i understanding that right.. is the
custom error the only option at that point... at least from a more web site
prospective..
thanks
shannon
>
> 404s for html, asp, etc. are handled "out of the box" by IIS,
> without the need for a custom page for 404 errors, but .aspx files are not.
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 21:39:48 von jvcoach23
if i do the error message capturing before the server.transfer.. then i'd
be able to get the error message ok... that sound correct..
thanks
shannon
Re: global.aspx Application_error does not fire on anything other than
am 16.01.2008 21:53:20 von nomailreplies
Yes. That's exactly what the sample I posted for you does.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"jvcoach23" wrote in message news:16o3ubx1yrca5$.1temqyplgxuu2.dlg@40tude.net...
> if i do the error message capturing before the server.transfer.. then i'd
> be able to get the error message ok... that sound correct..
>
> thanks
> shannon