Custom Error Page While Accessing ASP.NET Site Remotely From Server
How to resolve a weird server error with ASP.NET on Windows Server 2012.
Join the DZone community and get the full member experience.Join For Free
in this blog, i am going to show you how to show the default error page when accessing an asp.net site remotely from the server.
a few days ago, i hosted my asp.net application on windows server 2012 r2 and tried to access it from the remote machine, but surprisingly i got the following error, which i didn't get locally. when i debugged it, i learned some new thing in iis so i just thought to share my knowledge with other beginners like me.
screenshot of the error
reason for the error
when you access the page from the server (remote machine), iis assumes that you could handle the error by yourself and it won't show the default error pages to us.
how to resolve this error
resolving this error will be very easy, you just need to add one line of code in the web config file as follows:
this tells the iis that we didn't handle or provide any custom page for the error, so you could provide the default error pages which are already configured by default like below:
i hope the above information is useful for when developers get the error like above for the first time and understand the root cause of the problem.
Opinions expressed by DZone contributors are their own.