Click here to Skip to main content
15,906,766 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am getting below exception in my event Log. I have no steps, why this occurs, Any help is appreciated.

C#
Exception: System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'. ---> System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: Sequence contains no matching element   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)   at ASP.views_guests_index_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer)   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   at ASP.shared_bookingprocess_master.__RenderContentBody(HtmlTextWriter __w, Control parameterContainer)   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   at ASP.shared_bookingengine_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer)   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer)   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   at System.Web.UI.Page.HandleError(Exception e)   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   at System.Web.UI.Page.ProcessRequest()   at System.Web.UI.Page.ProcessRequest(HttpContext context)   at ASP.views_guests_index_aspx.ProcessRequest(HttpContext context)   at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.b__3()   at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)   at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)   at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)   at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)   at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)   at System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext)   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.b__19()   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)   at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
Posted
Updated 3-Aug-12 2:14am
v2

I'm going to post a meta-solution again. Make sure you have a sufficient grounding in the technology before you use it; you may need to step back and take a slower paced C# course. Reading and interpreting exception messages is an important part of being a good developer, and this one is fairly clear, so you shouldn't need to ask us about it.

This one says "System.InvalidOperationException: Sequence contains no matching element". That's pretty clear: you tried to call First on a list which didn't contain any items that matched the search criteria.
 
Share this answer
 
Seems like you are using LINQ in your code. First() will throw an exception if it can't find any matching elements. See if following post helps you:

http://stackoverflow.com/questions/3994336/sequence-contains-no-matching-element[^]
http://stackoverflow.com/questions/9907963/linq-query-issue-sequence-contains-no-elements[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900