'/' 應用程式中發生伺服器錯誤。

並未將物件參考設定為物件的執行個體。

描述: 在執行目前 Web 要求的過程中發生未處理的例外狀況。請檢閱堆疊追蹤以取得錯誤的詳細資訊,以及在程式碼中產生的位置。

例外狀況詳細資訊: System.NullReferenceException: 並未將物件參考設定為物件的執行個體。

原始程式錯誤:


行 359:                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-expanded="false" title="打開 @item.Name">@item.Name</a> @*第一層*@
行 360:                <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
行 361:                    @if (item.AboutUs.Where(m => m.IsEnable == true).Count() > 0)//第二層
行 362:                    {
行 363:                        foreach (var items in item.AboutUs.Where(m => m.IsEnable == true).OrderBy(m => m.SortId))//第二層迴圈

原始程式檔: D:\CMUHWebSiteV3_1\Views\Shared\_Navbar_New.cshtml    行: 361

堆疊追蹤:


[NullReferenceException: 並未將物件參考設定為物件的執行個體。]
   System.Data.Entity.Core.Objects.DataClasses.RelationshipManager.TryGetCachedRelatedEnd(String relationshipName, String targetRoleName, RelatedEnd& relatedEnd) +111
   System.Data.Entity.Core.Objects.DataClasses.RelationshipManager.GetRelatedCollection(AssociationEndMember sourceMember, AssociationEndMember targetMember, NavigationPropertyAccessor sourceAccessor, NavigationPropertyAccessor targetAccessor, RelatedEnd existingRelatedEnd) +110
   System.Data.Entity.Core.Objects.<>c__DisplayClass4`2.<CreateGetRelatedEndMethod>b__1(RelationshipManager manager, RelatedEnd relatedEnd) +111
   System.Data.Entity.Core.Objects.DataClasses.RelationshipManager.GetRelatedEndInternal(String relationshipName, String targetRoleName, RelatedEnd existingRelatedEnd, AssociationType relationship) +227
   System.Data.Entity.Core.Objects.DataClasses.RelationshipManager.GetRelatedEndInternal(String relationshipName, String targetRoleName) +134
   System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.LoadProperty(TItem propertyValue, String relationshipName, String targetRoleName, Boolean mustBeNull, Object wrapperObject) +122
   System.Data.Entity.Core.Objects.Internal.<>c__DisplayClass7`2.<GetInterceptorDelegate>b__1(TProxy proxy, TItem item) +151
   System.Data.Entity.DynamicProxies.AboutUsType_AA8F87084E9F88F72F3DA1B5A163A027303FF464C42F515B3F7E1FAF52409B21.get_AboutUs() +48
   ASP._Page_Views_Shared__Navbar_New_cshtml.Execute() in D:\CMUHWebSiteV3_1\Views\Shared\_Navbar_New.cshtml:361
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +251
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +147
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +121
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +377
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +90
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +43
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c__DisplayClass5_0.<Wrap>b__0() +18
   System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +29
   System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1898

[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) +2596
   System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +131
   System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +29
   System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +573
   System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +113
   ASP._Page_Views_Shared__Layout_New_cshtml.Execute() in D:\CMUHWebSiteV3_1\Views\Shared\_Layout_New.cshtml:297
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.WebPages.<>c__DisplayClass40_0.<RenderPageCore>b__0(TextWriter writer) +309
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +108
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +89
   System.Web.WebPages.WebPageBase.PopContext() +310
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +378
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +91
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +43
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +651
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +220
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134


版本資訊: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.8.4797.0
百度 搜狗 360搜索 比起看皇室,观众更想看我煮稀有意大利面 奶爸为过敏宝宝亲测一千多种护肤品 美卫生部长:在9月前找出自闭症病因 省委管理干部任前公示公告 美国正式对中国加收104%关税!接下来的11个预测...

      <code id='f1550'></code><style id='b4ff1'></style>
    • <acronym id='840db'></acronym>
      <center id='33653'><center id='04424'><tfoot id='0421c'></tfoot></center><abbr id='14443'><dir id='7d84c'><tfoot id='8d76d'></tfoot><noframes id='8b0f2'>

    • <optgroup id='92667'><strike id='e8066'><sup id='38de2'></sup></strike><code id='f8f47'></code></optgroup>
        1. <b id='69d93'><label id='6fcfa'><select id='2eed7'><dt id='a075a'><span id='1467d'></span></dt></select></label></b><u id='c32fa'></u>
          <i id='0e5b9'><strike id='f4df4'><tt id='77eb8'><pre id='b47c8'></pre></tt></strike></i>