Форум программистов, компьютерный форум, киберфорум
and_y87
Войти
Регистрация
Восстановить пароль
Оценить эту запись

Даже "лучше" совершают ошибки

Запись от and_y87 размещена 19.02.2024 в 21:13
Обновил(-а) and_y87 19.02.2024 в 21:15

Сегодня словил ошибку в MGTS.


Server Error in '/' Application.

The model item passed into the dictionary is of type 'MGTS.LK.BLL.Models.MainPageModel', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[MGTS.LK.DAL.Domain.MGTS_LK.IClientTemplate]'.

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: The model item passed into the dictionary is of type 'MGTS.LK.BLL.Models.MainPageModel', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[MGTS.LK.DAL.Domain.MGTS_LK.IClientTemplate]'.

Source Error:
Код:
Line 4:  <img src="~/img/loader.gif" />
Line 5:  @section templates {
Line 6:      @{ Html.RenderPartial("~/Views/Shared/Templates/QpTemplates.cshtml", (IEnumerable<IClientTemplate>)ViewBag.CommonTemplates); }
Line 7:      @{ Html.RenderPartial("~/Views/Shared/Templates/QpTemplates.cshtml", Model.Templates); }
Line 8:  }
Source File: C:\inetpub\wwwroot\mgts_lk\Views\Home\Index.cshtml Line: 6

Stack Trace:
Код:
[InvalidOperationException: The model item passed into the dictionary is of type 'MGTS.LK.BLL.Models.MainPageModel', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[MGTS.LK.DAL.Domain.MGTS_LK.IClientTemplate]'.]
   System.Web.Mvc.ViewDataDictionary`1.SetModel(Object value) +190
   System.Web.Mvc.ViewDataDictionary..ctor(ViewDataDictionary dictionary) +155
   System.Web.Mvc.WebViewPage`1.SetViewData(ViewDataDictionary viewData) +78
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +137
   System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper htmlHelper, String partialViewName, Object model) +103
   ASP._Page_Views_Home_Index_cshtml.<Execute>b__3_0() in C:\inetpub\wwwroot\mgts_lk\Views\Home\Index.cshtml:6
   System.Web.WebPages.<>c__DisplayClass7.<RenderSection>b__5(TextWriter tw) +414
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +108
   ASP._Page_Views_Shared__Layout_cshtml.Execute() in C:\inetpub\wwwroot\mgts_lk\Views\Shared\_Layout.cshtml:87
   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__DisplayClass3.<RenderPageCore>b__2(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) +793
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +793
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +32
   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.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +46
   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
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4676.0
Всего комментариев 0
Комментарии
 
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru