I have an ASP.NET MVC application and I log exceptions to email. It works fine from a local machine but when deployed to production, I don't get a full stack trace for the exception. It just reports "System.NullReferenceException: Object reference not set to an instance of an object at MyApplication.Web.Controllers.AccessController.Index()"
.
How can I get full stack trace including line numbers? Thanks!
namespace MyApplication.Web.Controllers
{
public class AccessController : Controller
{
public ActionResult Index()
{
try
{
//code
}
catch (Exception ex)
{
var exceptionString = ex.ToString();
//Send email
}
}
}
}