Do I need to wrap my code with try...catch statements if I use ELMAH?
I have the following code:
namespace ElmahTestApp.Controllers
{
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
try
{
DateTime date = DateTime.Parse("asdasdasd");
}
catch (Exception ex)
{
}
return View();
}
}
}
The view shows up (as expected) however the exception does not get logged. Any suggestions? THanks in advance!
Look at ErrorSignal. In your case, you’d do something like