0

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:

  1. The user clicks on a link to display a web form
  2. The user inserts data.
  3. The user submits the form.
  4. 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?

JPCF
  • 154
  • 2
  • 9

1 Answers1

0

Did you double-check if the correct version of View files are deployed? Maybe they were copied but not refreshed on the production server after you've made some changes?

Another hint: is it connected to some session or cookie issues? You are some questions to ask and some suggestions:

  • Can you reproduce it?
  • Does it happen with different browsers/versions?
  • Use a HTTP analyzer like Fiddler to debug the information (form, http headers etc.) travelling from the client to the server

In your case I assume it has something to do with the authentication mode. Maybe in your intranet you're automatically authenticated because you're all Windows domain users. But I assume that your production server is outside your Windows domain, so that configuration does not apply.

splattne
  • 28,348
  • 19
  • 97
  • 147