Showing Runtime Error in MVC application after deploy

I made a new MVC Project in Visual Studio 2015, then published that package and uploaded into my Windows hosting. After extraction when I browse my URL it shows me this error message. But my application runs on locally just fine.

enter image description here

Upvotes: 1

Views: 8566

Answers (1)

Ammar Alyasry
Ammar Alyasry

Reputation: 106

The custom error pages are not enabled for local in your code, you have to add mode="On". So customErrors looks something like this:

<customErrors mode="On" defaultRedirect="Error" redirectMode="ResponseRewrite">
  <error redirect="Error/NotFound" statusCode="404" />
</customErrors>

Upvotes: 2

Related Questions