.NET question about the customErrors Tag

G

Guest

A few (not all) of my clients are getting this error with a web thumbnail generator code I wrote

=============================
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
====================================

Some of them solved this issue by granting the ASPNET user full control on the application root folder, but some of them cannot get it to work at all

My code does the following thing

1) take file path from a querystrin
2) generate thumbnai
3) save thumbnail in a folder (there is a try..catch block here to make sure the ASPNET user has permission to save file
4) response.writefile the saved thumbnail to browse

Most users don't have this issue. Please let me know what might be the cause and what I can tell my clients to try

Thanks
 
C

CT

If you have access to the locals erver nachine, you could see the exact
error output, including the offending line. If not, create the customErrors
tag as suggested (temporarily) and see the error description in any browser.
 
S

Steven Cheng[MSFT]

Hi Samuel,

The <customErrors> element in asp.net's web.config file can help configure
how the client will view the web application's unhandled exception/error
info. By default, the mode is "RemoteOnly" which means only local client
can view the detailed info. So if you want other client also view the
detailed error info, you can set the mode as "Off". You can view the
following reference for detailed info:

#<customErrors> Element
http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfCustomerrorsSecti
on.asp?frame=true

In addition, I think you can also have a look at the asp.net's trace which
can also helpf troubleshooting your web application's issue:

#ASP.NET Trace
http://msdn.microsoft.com/library/en-us/cpguide/html/cpcontracefunctionality
.asp?frame=true

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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
S

Steven Cheng[MSFT]

Hi Samuel,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.

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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
G

Guest

Thanks Steven for your reply. I have a few questions

1) the software must be working because the majority of my clients don't have this issue.. Could this be a permission issue that needs to be done on the clients server

2) We do not use web.config file because the software is not configured as an application (not required). Will it work if I add an web.config file to the site's root directory? The software is installed in a folder called /gallery/ (not an application), and I am not sure if adding a web.config file to the root (/) directory will help. I dont have access to my client's server

Thanks!
 
S

Steven Cheng[MSFT]

Hi Samuel,

Thanks for the followup. To answer your questions:

1) the software must be working because the majority of my clients don't
have this issue.. Could this be a permission issue that needs to be done on
the clients server?
============================================================================
============
So far I'm also not very sure on it, we could only say it's a potential
cause. Have you try set the <customErrors>'s mode to "Off" and suggest the
user who encounter the error to post you the detailed error info? I think
that may help provide some clues.

2) We do not use web.config file because the software is not configured as
an application (not required). Will it work if I add an web.config file to
the site's root directory? The software is installed in a folder called
/gallery/ (not an application), and I am not sure if adding a web.config
file to the root (/) directory will help. I dont have access to my client's
server.
============================================================
Oh, now I got it that your application is in a sub folder under the root
applicatoin. If so, you'll be care to add a web.config because some
elements in the web.config is only allowed to be setting for and
application( which means the folder need to be configured as an application
in IIS) rather than a normal folder. Since you didn't provde a web.config
it'll derive the configuration from the Root Application(which may derive
from machine.config).

Also, still think the detailed error info is necessary for troubleshooting.
If you have any new findings, please feel free to post here. Thanks.



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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

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