Last post Jun 18, 2016 12:49 AM by lberan
Jun 17, 2016 05:24 PM|lberan|LINK
In the web.config file, I have this line:
<customErrors mode="RemoteOnly" defaultRedirect="~/Shared/Error"/>
I have deployed the MVC app to Azure. When I tried to view the error page by URL like this http://myazuresiteurl.azurewebsites.net/Shared/Error, I got returned url as http://myazuresiteurl.azurewebsites.net/Shared/Error?aspxerrorpath=/Shared/Error with this
error: An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated.
I checked online for solution and found one by suggesting to change the line in web.config file to
<customErrors mode="RemoteOnly" defaultRedirect="../Shared/Error"/>
Although it does not return the original error any more, it returns a blank page, which is still not acceptable. Could anybody help me with a solution? Thank you very much in advance.
Jun 18, 2016 12:49 AM|lberan|LINK
After reading the codes, I have understood why I got the error: "Shared" is not a controller but a folder name. The routing requires a controller name instead. I fixed this issue by adding the following code in Home controller:
public ActionResult Error()
and change the line in web.config file to:
<customErrors mode="RemoteOnly" defaultRedirect="~/Home/Error"/>
Error view stays in Shared folder.