asp.net mvc - I don't understand the stack trace from a clients website. System.NullReferenceException: Object reference not set to an instance of an object -


the web application asp mvc. can't figure out object reference not set instance of object means. database related or ajax failing? not familiar asp mvc apps. , when try go admin page, index.apsx keeps getting injected in wrong place in url, causes that?

server error in '/' application.

object reference not set instance of object.

description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code.

exception details: system.nullreferenceexception: object reference not set instance of object.

source error:

an unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below.

stack trace:

[nullreferenceexception: object reference not set instance of object.] boatingsafety.utils.createcontext() in c:\inetpub\wwwroot\appdevprojects\asp.net\boatingsafety\boatingsafety\supportclasses\utils.cs:27 boatingsafety.controllers.pagecontroller.index() in c:\inetpub\wwwroot\appdevprojects\asp.net\boatingsafety\boatingsafety\controllers\pagecontroller.cs:31 lambda_method(executionscope , controllerbase , object[] ) +40 system.web.mvc.actionmethoddispatcher.execute(controllerbase controller, object[] parameters) +17 system.web.mvc.reflectedactiondescriptor.execute(controllercontext controllercontext, idictionary`2 parameters) +178 system.web.mvc.controlleractioninvoker.invokeactionmethod(controllercontext controllercontext, actiondescriptor actiondescriptor, idictionary`2 parameters) +24 system.web.mvc.<>c__displayclassd.<invokeactionmethodwithfilters>b__a() +53 system.web.mvc.controlleractioninvoker.invokeactionmethodfilter(iactionfilter filter, actionexecutingcontext precontext, func`1 continuation) +258 system.web.mvc.<>c__displayclassf.<invokeactionmethodwithfilters>b__c() +20 system.web.mvc.controlleractioninvoker.invokeactionmethodwithfilters(controllercontext controllercontext, ilist`1 filters, actiondescriptor actiondescriptor, idictionary`2 parameters) +193 system.web.mvc.controlleractioninvoker.invokeaction(controllercontext controllercontext, string actionname) +300 system.web.mvc.controller.executecore() +104 system.web.mvc.controllerbase.execute(requestcontext requestcontext) +36 system.web.mvc.controllerbase.system.web.mvc.icontroller.execute(requestcontext requestcontext) +7 system.web.mvc.mvchandler.processrequest(httpcontextbase httpcontext) +59 system.web.mvc.mvchandler.processrequest(httpcontext httpcontext) +54 system.web.mvc.mvchandler.system.web.ihttphandler.processrequest(httpcontext httpcontext) +7 system.web.mvc.mvchttphandler.verifyandprocessrequest(ihttphandler httphandler, httpcontextbase httpcontext) +54 system.web.routing.urlroutinghandler.processrequest(httpcontextbase httpcontext) +111 system.web.routing.urlroutinghandler.processrequest(httpcontext httpcontext) +40 system.web.routing.urlroutinghandler.system.web.ihttphandler.processrequest(httpcontext context) +7 boatingsafety._default.page_load(object sender, eventargs e) in c:\inetpub\wwwroot\appdevprojects\asp.net\boatingsafety\boatingsafety\default.aspx.cs:22 system.web.util.callihelper.eventargfunctioncaller(intptr fp, object o, object t, eventargs e) +14 system.web.util.callieventhandlerdelegateproxy.callback(object sender, eventargs e) +35 system.web.ui.control.onload(eventargs e) +99 system.web.ui.control.loadrecursive() +50 system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint) +627 

nullreferenceexception generic exception.

when error, means somewhere in project there non nullable protected sample of code or in other words, trying call null.

example:

class1 obj = new class1(); obj.prop1 = 0; // ok obj = null;  obj.prop1 = 0; // throw system.nullreferenceexception 

see also

nullreferenceexception class

what nullreferenceexception , how fix it?

also:

utils.createcontext() in c:\inetpub\wwwroot\appdevprojects\asp.net\boatingsafety\boatingsafety\supportclasses\utils.cs:27

pagecontroller.index() in c:\inetpub\wwwroot\appdevprojects\asp.net\boatingsafety\boatingsafety\controllers\pagecontroller.cs:31

it occurs @ class utils in function createcontext line 27 , bubble /page/index line 31

pdb in production server

it seems have pdb in client production server. it's not recommended.

see more


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -