I have deplyoed asp.net mvc 3 razor view engine application on IIS 7. Server using windows server 2008 with sql server 2008. There is installed asp.net mvc 3
I have clicked publish button in Visual Studio 2010. Published it on local folder and then copied in server.
I am getting error > Sorry, an error occurred while processing your request.
This error shows only that views which does needs sql connection so other pages loading perfectly.
I am sure that i have changed connection string with correct connection string.
Please help me there is not anything helpful in web.
Thanks
Check the following:
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.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.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.