“/”应用程序中的服务器错误。

未将对象引用设置到对象的实例。

说明: 执行当前 web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: system.nullreferenceexception: 未将对象引用设置到对象的实例。

源错误:

行 37:             {
行 38:                 var parenttree = model.childtree.where(a => a.tree.treeid == focustreeinfo.tree.parent_treeid).firstordefault();
行 39:                 twodeptssiblingparentid = parenttree != null ? model.childtree.where(a => a.tree.treeid == parenttree.tree.parent_treeid).firstordefault().tree.parent_treeid : model.childtree.where(a => a.tree.treeid == focustreeinfo.tree.parent_treeid).firstordefault().tree.parent_treeid;
行 40:             }
行 41:             else if (focustreeinfo.tree.tlevel == 6)

源文件: d:\wwwroot\www.zpval.com\views\navi\subtop.cshtml    行: 39

堆栈跟踪:

[nullreferenceexception: 未将对象引用设置到对象的实例。]
   asp._page_views_navi_subtop_cshtml.execute() in d:\wwwroot\www.zpval.com\views\navi\subtop.cshtml:39
   system.web.webpages.webpagebase.executepagehierarchy() +198
   system.web.mvc.webviewpage.executepagehierarchy() +89
   system.web.webpages.webpagebase.executepagehierarchy(webpagecontext pagecontext, textwriter writer, webpagerenderingbase startpage) +90
   system.web.mvc.razorview.renderview(viewcontext viewcontext, textwriter writer, object instance) +222
   system.web.mvc.buildmanagercompiledview.render(viewcontext viewcontext, textwriter writer) +107
   system.web.mvc.viewresultbase.executeresult(controllercontext context) +292
   system.web.mvc.controlleractioninvoker.invokeactionresult(controllercontext controllercontext, actionresult actionresult) +13
   system.web.mvc.<>c__displayclass1c.<invokeactionresultwithfilters>b__19() +23
   system.web.mvc.controlleractioninvoker.invokeactionresultfilter(iresultfilter filter, resultexecutingcontext precontext, func`1 continuation) +245
   system.web.mvc.<>c__displayclass1e.<invokeactionresultwithfilters>b__1b() +22
   system.web.mvc.controlleractioninvoker.invokeactionresultfilter(iresultfilter filter, resultexecutingcontext precontext, func`1 continuation) +245
   system.web.mvc.<>c__displayclass1e.<invokeactionresultwithfilters>b__1b() +22
   system.web.mvc.controlleractioninvoker.invokeactionresultwithfilters(controllercontext controllercontext, ilist`1 filters, actionresult actionresult) +176
   system.web.mvc.controlleractioninvoker.invokeaction(controllercontext controllercontext, string actionname) +311
   system.web.mvc.controller.executecore() +105
   system.web.mvc.controllerbase.execute(requestcontext requestcontext) +88
   system.web.mvc.controllerbase.system.web.mvc.icontroller.execute(requestcontext requestcontext) +10
   system.web.mvc.<>c__displayclassb.<beginprocessrequest>b__5() +34
   system.web.mvc.async.<>c__displayclass1.<makevoiddelegate>b__0() +19
   system.web.mvc.async.<>c__displayclass8`1.<beginsynchronous>b__7(iasyncresult _) +10
   system.web.mvc.async.wrappedasyncresult`1.end() +55
   system.web.mvc.<>c__displayclasse.<endprocessrequest>b__d() +31
   system.web.mvc.securityutil.<getcallinapptrustthunk>b__0(action f) +7
   system.web.mvc.securityutil.processinapplicationtrust(action action) +23
   system.web.mvc.mvchandler.endprocessrequest(iasyncresult asyncresult) +59
   system.web.mvc.mvchandler.system.web.ihttpasynchandler.endprocessrequest(iasyncresult result) +9
   system.web.mvc.<>c__displayclassa.<endprocessrequest>b__9() +22
   system.web.mvc.<>c__displayclass4.<wrap>b__3() +10
   system.web.mvc.serverexecutehttphandlerwrapper.wrap(func`1 func) +27
   system.web.mvc.serverexecutehttphandlerwrapper.wrap(action action) +64
   system.web.mvc.serverexecutehttphandlerasyncwrapper.endprocessrequest(iasyncresult result) +71
   system.web.httpserverutility.executeinternal(ihttphandler handler, textwriter writer, boolean preserveform, boolean setpreviouspage, virtualpath path, virtualpath filepath, string physpath, exception error, string querystringoverride) +1097[httpexception (0x80004005): 执行处理程序“system.web.mvc.httphandlerutil+serverexecutehttphandlerasyncwrapper”的子请求时出错。]
   system.web.httpserverutility.executeinternal(ihttphandler handler, textwriter writer, boolean preserveform, boolean setpreviouspage, virtualpath path, virtualpath filepath, string physpath, exception error, string querystringoverride) +3174527
   system.web.httpserverutility.execute(ihttphandler handler, textwriter writer, boolean preserveform, boolean setpreviouspage) +76
   system.web.httpserverutility.execute(ihttphandler handler, textwriter writer, boolean preserveform) +28
   system.web.httpserverutilitywrapper.execute(ihttphandler handler, textwriter writer, boolean preserveform) +19
   system.web.mvc.html.childactionextensions.actionhelper(htmlhelper htmlhelper, string actionname, string controllername, routevalsuedictionary routevalsues, textwriter textwriter) +464
   system.web.mvc.html.childactionextensions.renderaction(htmlhelper htmlhelper, string actionname, string controllername) +35
   asp._page_views_shared__layout_cshtml.execute() in d:\wwwroot\www.zpval.com\views\shared\_layout.cshtml
   system.web.webpages.webpagebase.executepagehierarchy() +198
   system.web.mvc.webviewpage.executepagehierarchy() +89
   system.web.webpages.webpagebase.executepagehierarchy(webpagecontext pagecontext, textwriter writer, webpagerenderingbase startpage) +90
   system.web.webpages.<>c__displayclass7.<renderpagecore>b__6(textwriter writer) +103
   system.web.webpages.helperresult.writeto(textwriter writer) +10
   system.web.webpages.webpagebase.write(helperresult result) +80
   system.web.webpages.webpagebase.rendersurrounding(string partialviewname, action`1 body) +65
   system.web.webpages.webpagebase.popcontext() +277
   system.web.webpages.webpagebase.executepagehierarchy(webpagecontext pagecontext, textwriter writer, webpagerenderingbase startpage) +98
   system.web.mvc.razorview.renderview(viewcontext viewcontext, textwriter writer, object instance) +222
   system.web.mvc.buildmanagercompiledview.render(viewcontext viewcontext, textwriter writer) +107
   system.web.mvc.viewresultbase.executeresult(controllercontext context) +292
   system.web.mvc.controlleractioninvoker.invokeactionresult(controllercontext controllercontext, actionresult actionresult) +13
   system.web.mvc.<>c__displayclass1c.<invokeactionresultwithfilters>b__19() +23
   system.web.mvc.controlleractioninvoker.invokeactionresultfilter(iresultfilter filter, resultexecutingcontext precontext, func`1 continuation) +245
   system.web.mvc.<>c__displayclass1e.<invokeactionresultwithfilters>b__1b() +22
   system.web.mvc.controlleractioninvoker.invokeactionresultfilter(iresultfilter filter, resultexecutingcontext precontext, func`1 continuation) +245
   system.web.mvc.<>c__displayclass1e.<invokeactionresultwithfilters>b__1b() +22
   system.web.mvc.controlleractioninvoker.invokeactionresultfilter(iresultfilter filter, resultexecutingcontext precontext, func`1 continuation) +245
   system.web.mvc.<>c__displayclass1e.<invokeactionresultwithfilters>b__1b() +22
   system.web.mvc.controlleractioninvoker.invokeactionresultwithfilters(controllercontext controllercontext, ilist`1 filters, actionresult actionresult) +176
   system.web.mvc.controlleractioninvoker.invokeaction(controllercontext controllercontext, string actionname) +311
   system.web.mvc.controller.executecore() +105
   system.web.mvc.controllerbase.execute(requestcontext requestcontext) +88
   system.web.mvc.controllerbase.system.web.mvc.icontroller.execute(requestcontext requestcontext) +10
   system.web.mvc.<>c__displayclassb.<beginprocessrequest>b__5() +34
   system.web.mvc.async.<>c__displayclass1.<makevoiddelegate>b__0() +19
   system.web.mvc.async.<>c__displayclass8`1.<beginsynchronous>b__7(iasyncresult _) +10
   system.web.mvc.async.wrappedasyncresult`1.end() +55
   system.web.mvc.<>c__displayclasse.<endprocessrequest>b__d() +31
   system.web.mvc.securityutil.<getcallinapptrustthunk>b__0(action f) +7
   system.web.mvc.securityutil.processinapplicationtrust(action action) +23
   system.web.mvc.mvchandler.endprocessrequest(iasyncresult asyncresult) +59
   system.web.mvc.mvchandler.system.web.ihttpasynchandler.endprocessrequest(iasyncresult result) +9
   system.web.callhandlerexecutionstep.system.web.httpapplication.iexecutionstep.execute() +9651188
   system.web.httpapplication.executestep(iexecutionstep step, boolean& completedsynchronously) +155


版本信息: microsoft .net framework 版本:4.0.30319; asp.net 版本:4.0.30319.34209