By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,696 Members | 2,256 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,696 IT Pros & Developers. It's quick & easy.

Machine.config and customErrors

P: n/a
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
Dec 27 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <me******@hotmail.com>
| 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: <mc******************************@speakeasy.net>
| Lines: 11
| NNTP-Posting-Host: 66.92.91.130
| X-Trace:
sv3-FYuRqAsjoWp34Z1tpW1vLw/MUPOp/t7ssMd8bu/Apg6h8OG68tiBLBno8OKwyQUB3EVVnBu4
Cp/Orfl!9ZLHCq0H3AvJ/ExyscLuqohcoXCrhpI56AW+egeSk9ejltcMJdWZJBWeYIcsBUT jypAH
6ba5HkDR!+e4Li5L/s3hgZC/RC8TSrPKvOo32SA==
| X-Complaints-To: ab***@speakeasy.net
| X-DMCA-Complaints-To: ab***@speakeasy.net
| 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!TK2MSF TFEED02.phx.gbl!tornado.fa
stwebnet.it!tiscali!newsfeed1.ip.tiscali.net!proxa d.net!216.239.36.134.MISMA
TCH!postnews.google.com!news3.google.com!border1.n ntp.dca.giganews.com!nntp.
giganews.com!local01.nntp.dca.giganews.com!nntp.sp eakeasy.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
|
|
|

Dec 28 '05 #2

P: n/a
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: <mc******************************@speakeasy.net>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online.microsoft.com (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: <nx**************@TK2MSFTNGXA02.phx.gbl>
| 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" <me******@hotmail.com>
| | 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: <mc******************************@speakeasy.net>
| | Lines: 11
| | NNTP-Posting-Host: 66.92.91.130
| | X-Trace:
|
sv3-FYuRqAsjoWp34Z1tpW1vLw/MUPOp/t7ssMd8bu/Apg6h8OG68tiBLBno8OKwyQUB3EVVnBu4
|
Cp/Orfl!9ZLHCq0H3AvJ/ExyscLuqohcoXCrhpI56AW+egeSk9ejltcMJdWZJBWeYIcsBUT jypAH
| 6ba5HkDR!+e4Li5L/s3hgZC/RC8TSrPKvOo32SA==
| | X-Complaints-To: ab***@speakeasy.net
| | X-DMCA-Complaints-To: ab***@speakeasy.net
| | 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!TK2MSF TFEED02.phx.gbl!tornado.fa
|
stwebnet.it!tiscali!newsfeed1.ip.tiscali.net!proxa d.net!216.239.36.134.MISMA
|
TCH!postnews.google.com!news3.google.com!border1.n ntp.dca.giganews.com!nntp.
|
giganews.com!local01.nntp.dca.giganews.com!nntp.sp eakeasy.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
| |
| |
| |
|
|

Jan 3 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.