Elmah MVC如何处理错误并显示错误页面

时间:2015-11-20 15:41:05

标签: c# asp.net-mvc elmah elmah.mvc

在asp mvc 5中,我已经使用NuGet安装了Elmah.MVC(2.1.2)。

现在在Action方法中,我引发了一个异常:

public class MyController : Controller
{
    public ActionResult Index()
    {

        throw new Exception("This is test Exception");
        return View();
    }
}

我可以成功查看登录

http://localhost:49353/elmah

但我该如何处理错误?如何在共享文件夹中显示错误页面?现在我在浏览器中看到了Exception not handling页面

0 个答案:

没有答案