We are deploying an MVC2 based app on IIS at production environment floating in Internet. An error occurs and this is the process to raise it:
- The user clicks on a link to display a web form
- The user inserts data.
- The user submits the form.
- The application shows an error. Its trace shows that a reference for an object is not set to an instance. Apparently MVC's engine loses HTTP POST request data regarding to the model so the system assigns a null for actions's parameter at an unspecified time in the action's execution.
On Testing environment, at our intranet, this problem never had happened.
Here is the error:
// Error
Exception Error: Object reference not set to an instance of an object.
Exception Source: MagaARPIU
Exception Data: System.Collections.ListDictionaryInternal
Exception Trace: at MagaARPIU.Areas.GestionComercial.Controllers.ProspectacionController.IngresarEmpresa(InfoEmpresa modelo) in C:\Desarrollo\calvarez\codigo\Gacela ARP - Publicaciones\Gacela ARP\Maga\MagaARPIU\Areas\GestionComercial\Controllers\ProspectacionController.cs:line 151 at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
// -- ProspectacionController.cs
105 [RolAuthorizationAttribute]
106 public ActionResult IngresarEmpresa()
107 {
108 var modelo = new InfoEmpresa();
...
113 modelo.DatosIdentificacion = new DatosIdentificacion();
...
137 return View("IngresarEmpresa1", modelo);
...
139 }
145 [HttpPost]
146 [RolAuthorizationAttribute]
147 public ActionResult IngresarEmpresa(InfoEmpresa modelo)
148 {
...
151 if (!modelo.DatosIdentificacion.Completo)
152 {
...
179 }
...
305 }
Do you know what is going on and how to solve this problem?