Site was working perfectly fine up until yesterday when this new error started appearing after login.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Sequence contains no matching element
Source Error:
Line 61: var allclient = new List<ClientViewModel>();
Line 62:
Line 63: var clients = CmsTreeManager.GetClient();
Line 64: allclient.AddRange(clients.Select(client => new ClientViewModel
Line 65: {
Source File: d:\home\site\wwwroot\Views\Orders.cshtml Line: 63
Stack Trace:
[InvalidOperationException: Sequence contains no matching element]
System.Linq.Enumerable.Single(IEnumerable`1 source, Func`2 predicate) +2795185
CdmPrint.Helpers.CmsTreeManager.GetClient() +297
ASP._Page_Views_Orders_cshtml.Execute() in d:\home\site\wwwroot\Views\Orders.cshtml:63
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +235
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +113
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +291
I'm not sure where to start looking to figure out what is causing this but the user has advised it occured after he was adding a new client in.
Around line 63 you'll likely see a list of properties being set. One of the them is null (not set). I'd bet some money on it being an image or something "picked"... or could it be that this client doesn't have any orders (as I'm guessing that's what this page lists?).
If you post the code in that file here can probably advise how to change it to "null check".
Hmm.. looking at that it looks like the call to CmsTreeManager.GetClient(); is returning null.
I'd suggest you go carefully through this client setup and make sure that they have all the data set. And that they are a "member" of the correct groups etc. Without seeing the logic in GetClient it's hard to see.
Do you have the source code? It would be worth debugging this if you can.
Server Error in '/' Application.
Hi Guys,
Site was working perfectly fine up until yesterday when this new error started appearing after login.
I'm not sure where to start looking to figure out what is causing this but the user has advised it occured after he was adding a new client in.
If you look in the file \Views\Orders.cshtml
Around line 63 you'll likely see a list of properties being set. One of the them is null (not set). I'd bet some money on it being an image or something "picked"... or could it be that this client doesn't have any orders (as I'm guessing that's what this page lists?).
If you post the code in that file here can probably advise how to change it to "null check".
Hi, below is a snippet of orders.cshtml from the lines before and after 63 which is causing the errors.
How would I go changing this to a null check, the page was working perfectly fine up until yesterday when the user advised they added a new client.
Hmm.. looking at that it looks like the call to CmsTreeManager.GetClient(); is returning null.
I'd suggest you go carefully through this client setup and make sure that they have all the data set. And that they are a "member" of the correct groups etc. Without seeing the logic in GetClient it's hard to see.
Do you have the source code? It would be worth debugging this if you can.
Steve
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.