Asp.net Mvc 3 Web Application Does Not Working After Deploy
Solution 1:
First you have to know what is the exception that is causing the error view to show up.
I can suggest you three options.
Turn off the
<customErrors
> section, so theHandleError
filter won't work and you can see the real exception.The
HandleError
filter also passes aHandleErrorInfo
instance to the error view, so you can display the complete exception in the error view itself (just to know the error not a wise idea in production) by accessing that model.@model System.Web.Mvc.HandleErrorInfo <p> The exception is: @Model.Exception </p>
You can try ELMAH library that records all the un-handled exceptions. The
HandleError
filter suppresses the exception and stops them logged by ELMAH, so you should better switch off theHandleError
when you are trying ELMAH. You have to configure theELMAH
in a separate database and it provides a page that lists all the recent errors.
Solution 2:
Check the following:
- The app pool you're deploying it to in IIS is using the correct version of .NET (should be using a .NET 4 Integrated Mode App Pool)
- If it's an error that's preventing anything from running in ASP.NET, then errors should be being logged to the Event Log on the server. Check the Application and/or System log.
Solution 3:
There is some error in some code of that requested page. So ASP.NET MVC is showing the content of error.cshtml.
You can disable custom error page in your web.config so that you can see the error in the browser. Keep in mind that not only you, everyone can see that. So you better change that settings back once you figure out what is the problem. You can also set the value to remoteonly
so that that only it will be visible from the server. This works only if you have remote access to the server.
Post a Comment for "Asp.net Mvc 3 Web Application Does Not Working After Deploy"