c# - ELMAH error logging : the wrong error message is returned -



c# - ELMAH error logging : the wrong error message is returned -

i'm trying utilize elmah error logging in mvc application. reason, reporting wrong error.

i set next code in controller class create sure error occurs:

int = 0; int b = 10 / a;

as code executed, errormail sent, , contains next message:

system.invalidoperationexception: view 'error' or master not found or no view engine supports searched locations. next locations searched: ~/views/home/error.aspx ~/views/home/error.ascx ~/views/shared/error.aspx ~/views/shared/error.ascx ~/views/home/error.cshtml ~/views/home/error.vbhtml ~/views/shared/error.cshtml ~/views/shared/error.vbhtml

but view correctly generated. don't see real exception, "fake" 1 above.

i have next web.config file:

<configsections> <sectiongroup name="elmah"> <section name="security" requirepermission="false" type="elmah.securitysectionhandler, elmah" /> <section name="errorlog" requirepermission="false" type="elmah.errorlogsectionhandler, elmah" /> <section name="errormail" requirepermission="false" type="elmah.errormailsectionhandler, elmah" /> <section name="errorfilter" requirepermission="false" type="elmah.errorfiltersectionhandler, elmah" /> </sectiongroup> </configsections> <elmah> <errorlog type="elmah.xmlfileerrorlog, elmah" logpath="~/app_data" /> <errormail from="noreply@website.com" to="me@mycompany.com" cc="you@mycompany.com" bcc="bcc@mycompay.com" subject="elmah error mail" /> <security allowremoteaccess="true" /> <!--elmah--> </elmah> <system.web> <customerrors mode="on" defaultredirect="~/error/generalerror"> <error statuscode="404" redirect="~/error/http404" /> </customerrors>

as can see, i'm using different page 404-error, , general error (which simply: rest). have errorcontroller, these 2 methods:

public class errorcontroller : controller { public actionresult http404() { homecoming view(); } public actionresult generalerror() { homecoming view(); } }

if utilize standard "error.aspx" in shared folder, see right page, no errormail beingness sent, take elmah isn't handling exception.

can spot i'm doing wrong? need post more code?

thanks lot help can give me.

from message ~/views/home/error.aspx looks trying find view called error.aspx think in shared/ folder default when creating mvc3 site..

maybe should @ :

http://weblogs.asp.net/scottgu/archive/2008/07/14/asp-net-mvc-preview-4-release-part-1.aspx

c# asp.net-mvc elmah

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -