Revious
Revious

Reputation: 8146

Change to Web.config on IIS throws an exception. IIS reset needed

The situation is described by this question where the user updates the Web.config and he gets a weird error (completely unrelated from the real problem).

https://stackoverflow.com/a/7142817/196210

Is it possible to tell IIS to avoid creating problem when the config file is edited?

It appears that the problem is related to editing the file with VS.NET while editing it with Notepad++ works

Server Error in '/' Application

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>

Upvotes: 0

Views: 1196

Answers (1)

Ashish Gupta
Ashish Gupta

Reputation: 24

IIS 7.0 or later will take the settings from web.config files. If your file is not properly edited, it won't be parsed by IIS and will not work at all.

You need to either change the custom error page to view the error outside the server or loginto the server and check the error. this way you will be able to see the error and fix it.

Upvotes: 1

Related Questions