In the config of my application I deleted the customErrors to do a test of an error that is difficult to replicate.
And where the error should be I put a try:
if (ModelState.IsValid)
{
db.TarefaHoras.Add(tarefaHora);
try
{
db.SaveChanges();
}
catch (DbUpdateException ex)
{
ErroDetalhe erro = new ErroDetalhe();
erro.Data = tarefaHora.Data;
erro.UsuarioId = tarefaHora.ApplicationUserId;
erro.JSON = JsonConvert.SerializeObject(tarefaHora);
erro.Tipo = "TarefaHora";
erro.Controller = "TarefaHoras";
erro.Action = "Create Post";
erro.Exception = ex.GetType().FullName;
db.ErroDetalhes.Add(erro);
db.SaveChanges();
return RedirectToAction("ErroNaAtualizacaoDaBase", "Erros", new { id = erro.ID });
}
return RedirectToAction("Index", "Home");
}
ViewBag.TipoTarefaID = new CBMMSapp.DAO.TiposTarefaDAO().ListaParaDropDown();
ViewBag.ApplicationUserId = new CBMMSapp.DAO.UsuariosDAO().ListaParaDropDown(tarefaHora.ApplicationUserId);
ViewBag.ClienteID = new CBMMSapp.DAO.ClientesDAO().ListaParaDropDown();
return View(tarefaHora);
}
This error only happens at runtime and only on the Azure server, so my attempt was to get a better description of the error and for this I created a table where the information is deposited.
But ....
The problem is that the View error that I'm getting is not the View View Error in the UpdateBase I created and that is redirected in Catch.
This is the default AspNET error view.
So I went into the Shared views and deleted the default page and removed the custom.rules from web.config.
And yet Azure still brings the default error view.
Does anyone have any idea what might be happening?