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

Sequence contains no elements

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

异常详细信息: System.InvalidOperationException: Sequence contains no elements

源错误:

行 1:  @{var categories=(((Kooboo.CMS.Content.Models.TextContent)ViewBag.Article).Categories("Category")).OrderBy("ParentUUID");
行 2:  
行 3:                                	var pc=categories.WhereEquals("ParentUUID", null).First();
行 4:                                var name=pc["Title"].ToString();
行 5:                                 var pp=Kooboo.CMS.Sites.Services.ServiceFactory.PageManager.All(Kooboo.CMS.Sites.Models.Site.Current,name).First();                           

源文件: d:\wwwroot\GuoHong\Cms_Data\Sites\※矿业※新\Templates\Views\文章.内容\template.cshtml    行: 3

堆栈跟踪:

[InvalidOperationException: Sequence contains no elements]
   Kooboo.CMS.Content.Persistence.SqlServer.QueryProcessor.ContentQueryExecutorBase`1.First(SQLServerVisitor`1 visitor) +86
   Kooboo.CMS.Content.Persistence.SqlServer.QueryProcessor.ContentQueryExecutorBase`1.Execute() +231
   Kooboo.CMS.Content.Persistence.SqlServer.TextContentProvider.Execute(IContentQuery`1 query) +52
   Kooboo.CMS.Content.Query.ContentQuery`1.First() +137
   ASP._Page_Cms_Data_Sites_※矿业※新_Templates_Views_文章_内容_template_cshtml.Execute() in d:\wwwroot\GuoHong\Cms_Data\Sites\※矿业※新\Templates\Views\文章.内容\template.cshtml:3
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +253
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +147
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Kooboo.CMS.Sites.View.PositionRender.ViewRender.RenderViewInternal(HtmlHelper htmlHelper, String viewPath, ViewDataDictionary viewData, Object model) +334
   Kooboo.CMS.Sites.View.PositionRender.ViewRender.RenderView(HtmlHelper htmlHelper, Page_Context pageContext, String viewName, ViewDataDictionary viewData, Object parameters, Boolean executeDataRule) +689
   Kooboo.CMS.Sites.View.FrontHtmlHelper.RenderView(String viewName, ViewDataDictionary viewData, Object parameters, Boolean executeDataRule) +62
   Kooboo.CMS.Sites.View.<>c__DisplayClass13.<RenderView>b__11() +91
   Kooboo.CMS.Sites.View.FrontHtmlHelper.RenderView(ViewPosition viewPosition) +577
   Kooboo.CMS.Sites.View.<RenderPositionContents>d__b.MoveNext() +432
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +148
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +106
   Kooboo.CMS.Sites.View.FrontHtmlHelper.Position(String positionID, Func`1 defaultContentFunc) +288
   ASP._Page_Cms_Data_Sites_※矿业※新_Templates_Layouts_Layout_template_cshtml.Execute() in d:\wwwroot\GuoHong\Cms_Data\Sites\※矿业※新\Templates\Layouts\Layout\template.cshtml:62
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +253
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +147
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   Kooboo.CMS.Sites.Controllers.PageControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +85
   System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +31
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +437
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +663
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__19() +39
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +22
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +22
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +399
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157


版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.6.1590.0