1

Hay when i add defaultPath="/Error.aspx" to my web config i get an error that tells me that i have an error to my config. The problem is that without that all is going well with out errors. I have below some relevant settings:

<httpErrors defaultResponseMode="ExecuteURL" errorMode="Custom" existingResponse="Replace" >
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="/Err.aspx" responseMode="ExecuteURL" />
        </httpErrors>
<customErrors mode="On" defaultRedirect="~/Error.aspx" redirectMode="ResponseRewrite">
        <error statusCode="404" redirect="~/Err.aspx" />
    </customErrors>

Can you help me please. Do you know iis gives an error when i try to add a default path?

Pop Radu
  • 17
  • 5
  • Can you provide us the error which it outputs? If the error from IIS itself is too generic, look into the windows application event log. – TGlatzer Oct 24 '12 at 07:13
  • Where are you putting defaultPath="/Error.aspx" notice the others have ~ in front of them. – awright18 Oct 24 '12 at 07:17
  • @awright18 i put defaultPat in httpErrors and there is no ~ before – Pop Radu Oct 24 '12 at 07:25
  • @Grumbler85 when i try to run the debugger from visual studio i've got this An error like this: Make sure the server is operating correctly. Verify if there are no syntax errors in web.config – Pop Radu Oct 24 '12 at 07:28
  • @PopRadu What is the error if you open the page in an browser? What does the event log write? – TGlatzer Oct 24 '12 at 10:28
  • Similar question - http://stackoverflow.com/q/22709991/2164198 - no answer yet. – Ivan Samygin Sep 19 '14 at 08:53

1 Answers1

0

I was able to resolve this error only if I set setting "defaultPath" in file applicationHost.config of IIS.

Or you can set it with UI using next steps:
1) Open IIS
2) Select ServerName (not website)
3) Open menu "Error Pages"
4) Click "Edit Feature Setting" to the left.
5) Configure setting "Path" and other options in the popup.

Anton Palyok
  • 1,249
  • 1
  • 16
  • 27