locked
<customErrors mode="Off"/> not working RRS feed

  • Question

  • User227134471 posted

    I added the folowing to all the web.configs in my app. But I still can't see the errors remotly. How could this be? 

    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>
     
    Thanks for the help. 

    Saturday, September 16, 2006 7:34 AM

All replies

  • User1439985827 posted

    You also need to set debug to true: 

    <configuration>
    	<system.web>
    		<compilation debug="true" />
    		<customErrors mode="Off"/>
    	</system.web>
    </configuration>
     
    Saturday, September 16, 2006 1:15 PM
  • User227134471 posted

    Still doesn't work. Any other suggestions?

     

    Tnx 

    Monday, September 18, 2006 3:00 PM
  • User1439985827 posted
    Is debug set the "false" in the @Page Directive of your pages? If so, remove the attribute completely and it will inherit from the web.config or change it to true.
    Monday, September 18, 2006 8:11 PM
  • User227134471 posted
    I don't have debug set in the @Page Directive of my pages. 
    Tuesday, September 19, 2006 12:49 AM
  • User930584213 posted

    The same thing is happening to me.  I have this in my web.config

     <system.web>

    <compilation debug="true" />

    <customErrors mode="Off"/>

    </system.web>

    I have no debug in my @Page directive and I still see The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons).   

     

    Wednesday, October 15, 2008 12:51 PM
  • User-1853252149 posted

    1)  Debug makes no difference.

    2)  Check your database connection string.

    3)  Test on the server itself.

    Jeff

    Thursday, October 16, 2008 2:23 PM
  • User739893848 posted

    Hi Jeff

     Okay I have now tried everything and still it gives the same thing:

    <!-- Web.Config Configuration File -->

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

     This is a copy of web.config, if someone could please help

    <?xml version="1.0"?>

    <configuration>

    <configSections>

    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

    <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>

    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>

    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>

    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>

    </sectionGroup>

    </sectionGroup>

    </sectionGroup>

    </configSections>

    <connectionStrings>

    <add name="connString" connectionString="Data Source=1.2.3.4;Initial Catalog=SomeDB;User Id=SomeId;Password=SomePassword;"/>

    </connectionStrings>

    <appSettings>

    <add key="FilePath" value="/DrillTech/Admin/Invoices/"/>

    <add key="ProductFilePath" value="/DrillTech/Admin/Products/"/>

    <add key="InvoiceImage" value="~/Admin/Invoices/"/>

    <add key="ProductImage" value="~/Admin/Products/"/>

    <add key="ImagePath" value="~/images/"/>

    <!--<add key="SMTPHost" value="1.2.3.4"/>-->

    <add key="AdminMail" value="admin@drilltech.co.za"/>

    </appSettings>

    <system.web>

    <pages>

    <controls>

    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="act"/>

    <add namespace="skmMenu" assembly="skmMenu" tagPrefix="skmMenu"/>

    </controls> </pages>

    <!--

    Set compilation debug="true" to insert debugging

    symbols into the compiled page. Because this

    affects performance, set this value to true only

    during development.

    -->

    <compilation debug="true">

    <assemblies>

    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

    <!--<add assembly="DevExpress.Data.v7.3, Version=7.3.3.0, Culture=neutral, PublicKeyToken=9B171C9FD64DA1D1"/>-->

    <!--<add assembly="DevExpress.Xpo.v7.3, Version=7.3.3.0, Culture=neutral, PublicKeyToken=9B171C9FD64DA1D1"/>-->

    </assemblies>

    </compilation>

    <httpHandlers>

    <remove verb="*" path="*.asmx"/>

    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>

    </httpHandlers>

    <httpModules>

    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    </httpModules>

    <customErrors mode="Off"/>

    </system.web>

    <system.web.extensions>

    <scripting>

    <webServices>

    <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->

    <!--

    <jsonSerialization maxJsonLength="500">

    <converters>

    <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>

    </converters>

    </jsonSerialization>

    --> <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->

    <!--

    <authenticationService enabled="true" requireSSL = "true|false"/>

    --><!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved

    and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and

    writeAccessProperties attributes.
    -->

    <!--

    <profileService enabled="true"

    readAccessProperties="propertyname1,propertyname2"

    writeAccessProperties="propertyname1,propertyname2" />

    --> </webServices>

    <!--

    <scriptResourceHandler enableCompression="true" enableCaching="true" />

    -->

    </scripting>

    </system.web.extensions>

    <system.net>

    <mailSettings>

    <smtp>

    <network host="1.2.3.4"/>

    </smtp>

    </mailSettings>

    </system.net>

    <system.webServer>

    <validation validateIntegratedModeConfiguration="false"/>

    <modules>

    <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    </modules>

    <handlers>

    <remove name="WebServiceHandlerFactory-Integrated"/>

    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    </handlers> </system.webServer>

    </configuration>

    Monday, November 3, 2008 5:14 AM
  • User-1625022785 posted

    i was looking through your code and saw and IP, password, network host address and username and was hoping that they are Fake  if not for security reason with  your company. Please remove them

     

    Monday, November 3, 2008 9:52 AM
  • User739893848 posted

    Sorry how do I do that I am new to all of this

    Monday, November 3, 2008 12:20 PM
  • User-1625022785 posted

    you should be able to click the edit button on your responses and be able to edit the content. so just click the edit button and go in and place something different in those spots.

    Monday, November 3, 2008 12:23 PM
  • User739893848 posted

    Gotcha thanks

    Monday, November 3, 2008 12:26 PM
  • User739893848 posted

    Hey Micah

    Do you by any chance have some sort of an idea of what I should, the problem I have is that this done from a hosting provider and they have done all the IIS set and everything and I cannot see what they have done, what the guy did say is that the site works on the server but when we try from the internet I get that fantastic error message, and I have now tried everything are there some security settings or what.

     Thanks
    Wayne

    Monday, November 3, 2008 12:31 PM
  • User-1625022785 posted

    well there is a chance that the site is still in the testing phase, which means that the guy still has the site only being accessed on there IP address and forgot to change the setting to allow everyone to access the site.

    or

    it depends on that error that you are recieving

     To get more opinions on this post this question in another forum in security copy and paste the error on this forum so we can see it

     

    Monday, November 3, 2008 12:40 PM
  • User739893848 posted

    This is the error

    Server Error in '/' Application.

    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>

     

    If you have a look at my web.config file from the previous post you will see that I have set the custom errors tag, please, please, this thing is now driving me insane, this is an Ajax site and I have uploaded all the dll's to the bin folder that can be uploaded, I just need to see the error to point me in a direction.

    Thanks

    Monday, November 3, 2008 12:46 PM
  • User-1625022785 posted

    have you tried to turn the customErrors "On" and see what happens

    Monday, November 3, 2008 1:10 PM
  • User739893848 posted

    Sadly I have tried that as well.

    Monday, November 3, 2008 1:41 PM
  • User-1625022785 posted

    figure out a way to get your web.config to go back before you started to have this error and work from there line by line

    Monday, November 3, 2008 4:24 PM
  • User-1625022785 posted

    Hey i dont know if you have resolved this problem but i have ran into it 3 or 4 times since we talked and i have problems

    where the ";" would be in the wrong place. or the action that i was trying to take was not recognized. So check your placement of the string to see if you make a difference

    Wednesday, November 5, 2008 9:09 AM
  • User739893848 posted

    Thanks MicahG

    The problem is fixed, the problem was lying with the service provider, thanks for all the feedback.

    Wednesday, November 5, 2008 11:45 AM
  • User1485238302 posted

    Check to see if the target framework of your application is the same as one assigned to it on the web server.

    Wednesday, November 5, 2008 11:57 AM
  • User739893848 posted

    Thanks Max

    The problem was actually lying with the service provider.

    Wednesday, November 5, 2008 12:02 PM
  • User1485238302 posted

    Oops...I did not realize that this thread was 2 pages long and read the last reponse on the 1st page and responded after that. Good that it's resolved.

    Wednesday, November 5, 2008 12:05 PM
  • User-1452773542 posted

    I had the same problem and it was because the website was setup for .NET 1.1 and my application was 2.0. My ISP installed .NET 2.0 but never re-configured the web for it. The problem was that it was hitting errors in the WEB.CONFIG file way before it reached the <customErrors> tag.  Try putting that tag sequence 1st.

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

    ...now everything else

        </system.web>
    </configuration>

    Thursday, May 21, 2009 2:44 PM
  • User-671663492 posted

    http://stackoverflow.com/questions/101693/customerrors-mode-off

    This has been driving me insane for the past few days and couldn't get around it but have finally figured it out:

    In my machine.config file I had an entry:

    <deployment retail="true" />

    This seems to override any other customError settings that you have specified in a web.config file, so setting the above entry to:

    <deployment retail="false" />

    now means that I can once again see the detailed error messages that I need to.

    Hope that helps someone out there and saves a few hours of hair-pulling.

    Friday, July 11, 2014 2:03 AM
  • User1301841358 posted

    Thank you for this post re: <deployment retail="false"/>. I was pulling my hair out for half a day trying to figure out why <customErrors mode="Off" /> was having no effect. You saved me a lot of time.

    Wednesday, October 15, 2014 5:41 AM
  • User753101303 posted

    Hi,

    But the point is that you should never do that ;-) !!

    By doing this you allow anyone having an error to get those same détails which could leak some information about how your app works. So this is something you usually don't want to do on a production machine which is likely why retail="true" prevent doing this.

    Instead you should provide a generic error page that would give minimal information to users and log the details that only those in charge of handling application error should be able to get...

    Wednesday, October 15, 2014 4:50 PM
  • User-904569601 posted

    I'm sure that currently you have this issue resolved, but if anyone needs the solution, in my case i did:

    <system.web>

    <customErrors mode="Off" />

    </system.web>

    AND

    <system.webServer>

    <httpErrors existingResponse="PassThrough"></httpErrors>

    </system.webServer>

    This may resolve the problem.

    Usually you don't have to do nothing of this, but it depends on you IIS server configuration.

    Hope it helps.

    []'s

    Thursday, March 22, 2018 7:29 PM