Machine.config and customErrors

M

Max Metral

I'm trying to set the default behavior of customErrors in the
machine.config. The documentation seems to suggest this should work, but it
doesn't seem to work for me. On my development machine, I want customErrors
off, and on my production machine I want them to go to a friendly error page
(so on with a defaultRedirect). No matter what I do, I only get
"customErrors off" with setting in machine.config and not web.config.

Any thoughts?
--Max
 
S

Steven Cheng[MSFT]

Hi Max,

Welcome to ASP.NET newsgroup.
As for the <customErrors> setting, it can be configured at both
machine.config or application web.config level... Are you using asp.net
1.1 or 2.0?

<customErrors mode="On" defaultRedirect="~/GenericErrorPage.aspx">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>

For asp.net 1.1, we just need to configure the <customErros> element in
machine.config file.... and to make sure it take effect, you can run
"iisreset.exe" to restart IIS......

For asp.net 2.0, we use a global web.config (under
%windir%\microsoft.net\framework\vxxxx\config dir.....) instead of
machine.config for configuring machine level asp.net setting. So you can
put the <customErrors> setting in that global web.config file........

Also, after you save the change, if you're testing in VS2005's test server,
you can directly see the changes take effect. If you're hosting the
application in IIS, I also suggest you restart IIS......

In addition, both of the machine level <customErrors> setting mentioned
above can be override by appliation level web.config.....

If you have any further question or meet any particular problem, please
feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| NNTP-Posting-Date: Tue, 27 Dec 2005 10:02:35 -0600
| From: "Max Metral" <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Machine.config and customErrors
| Date: Tue, 27 Dec 2005 11:02:34 -0500
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <[email protected]>
| Lines: 11
| NNTP-Posting-Host: 66.92.91.130
| X-Trace:
sv3-FYuRqAsjoWp34Z1tpW1vLw/MUPOp/t7ssMd8bu/Apg6h8OG68tiBLBno8OKwyQUB3EVVnBu4
Cp/Orfl!9ZLHCq0H3AvJ/ExyscLuqohcoXCrhpI56AW+egeSk9ejltcMJdWZJBWeYIcsBUTjypAH
6ba5HkDR!+e4Li5L/s3hgZC/RC8TSrPKvOo32SA==
| X-Complaints-To: (e-mail address removed)
| X-DMCA-Complaints-To: (e-mail address removed)
| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
| X-Postfilter: 1.3.32
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fa
stwebnet.it!tiscali!newsfeed1.ip.tiscali.net!proxad.net!216.239.36.134.MISMA
TCH!postnews.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.
giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy
..net.POSTED!not-for-mail
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:367155
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I'm trying to set the default behavior of customErrors in the
| machine.config. The documentation seems to suggest this should work, but
it
| doesn't seem to work for me. On my development machine, I want
customErrors
| off, and on my production machine I want them to go to a friendly error
page
| (so on with a defaultRedirect). No matter what I do, I only get
| "customErrors off" with setting in machine.config and not web.config.
|
| Any thoughts?
| --Max
|
|
|
 
S

Steven Cheng[MSFT]

Hi Max,

How are you doing on this issue, does my last reply helps you a little?
If there're anything else we can help, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 41244368
| References: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Wed, 28 Dec 2005 02:26:07 GMT
| Subject: RE: Machine.config and customErrors
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 90
| Path: TK2MSFTNGXA02.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:367227
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Max,
|
| Welcome to ASP.NET newsgroup.
| As for the <customErrors> setting, it can be configured at both
| machine.config or application web.config level... Are you using asp.net
| 1.1 or 2.0?
|
| <customErrors mode="On" defaultRedirect="~/GenericErrorPage.aspx">
| <error statusCode="403" redirect="NoAccess.htm" />
| <error statusCode="404" redirect="FileNotFound.htm" />
| </customErrors>
|
| For asp.net 1.1, we just need to configure the <customErros> element in
| machine.config file.... and to make sure it take effect, you can run
| "iisreset.exe" to restart IIS......
|
| For asp.net 2.0, we use a global web.config (under
| %windir%\microsoft.net\framework\vxxxx\config dir.....) instead of
| machine.config for configuring machine level asp.net setting. So you can
| put the <customErrors> setting in that global web.config file........
|
| Also, after you save the change, if you're testing in VS2005's test
server,
| you can directly see the changes take effect. If you're hosting the
| application in IIS, I also suggest you restart IIS......
|
| In addition, both of the machine level <customErrors> setting mentioned
| above can be override by appliation level web.config.....
|
| If you have any further question or meet any particular problem, please
| feel free to post here.
|
| Regards,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
| --------------------
| | NNTP-Posting-Date: Tue, 27 Dec 2005 10:02:35 -0600
| | From: "Max Metral" <[email protected]>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | Subject: Machine.config and customErrors
| | Date: Tue, 27 Dec 2005 11:02:34 -0500
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | X-RFC2646: Format=Flowed; Original
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | Message-ID: <[email protected]>
| | Lines: 11
| | NNTP-Posting-Host: 66.92.91.130
| | X-Trace:
|
sv3-FYuRqAsjoWp34Z1tpW1vLw/MUPOp/t7ssMd8bu/Apg6h8OG68tiBLBno8OKwyQUB3EVVnBu4
|
Cp/Orfl!9ZLHCq0H3AvJ/ExyscLuqohcoXCrhpI56AW+egeSk9ejltcMJdWZJBWeYIcsBUTjypAH
| 6ba5HkDR!+e4Li5L/s3hgZC/RC8TSrPKvOo32SA==
| | X-Complaints-To: (e-mail address removed)
| | X-DMCA-Complaints-To: (e-mail address removed)
| | X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| | X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
| complaint properly
| | X-Postfilter: 1.3.32
| | Path:
|
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fa
|
stwebnet.it!tiscali!newsfeed1.ip.tiscali.net!proxad.net!216.239.36.134.MISMA
|
TCH!postnews.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.
|
giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy
| .net.POSTED!not-for-mail
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:367155
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | I'm trying to set the default behavior of customErrors in the
| | machine.config. The documentation seems to suggest this should work,
but
| it
| | doesn't seem to work for me. On my development machine, I want
| customErrors
| | off, and on my production machine I want them to go to a friendly error
| page
| | (so on with a defaultRedirect). No matter what I do, I only get
| | "customErrors off" with setting in machine.config and not web.config.
| |
| | Any thoughts?
| | --Max
| |
| |
| |
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top