I've got this error, Invalid Cast Exception, which I'm unable to get rid of, I've tried undoing the changes I can remember I've made and this has had no effect, I've also been searching on forums for what feels like hours now and have come here with hope someone can help me directly.
Details: System.InvalidCastException: [A]Umbraco.Web.PublishedContentModels.UsnglobalSettings cannot be cast to [B]Umbraco.Web.PublishedContentModels.UsnglobalSettings. Type A originates from 'AppWeball.generated.cs.8f9494c4.nefr6y-y, Version=0.0.0.2, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'D:\local\Temporary ASP.NET Files\root\5b01a537\da008739\AppWeball.generated.cs.8f9494c4.nefr6y-y.dll'. Type B originates from 'AppWeball.generated.cs.8f9494c4.ye-ur5eg, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'D:\local\Temporary ASP.NET Files\root\5b01a537\da008739\AppWeball.generated.cs.8f9494c4.ye-ur5eg.dll'.
Invalid Cast Execption
Hi All,
I've got this error, Invalid Cast Exception, which I'm unable to get rid of, I've tried undoing the changes I can remember I've made and this has had no effect, I've also been searching on forums for what feels like hours now and have come here with hope someone can help me directly.
Details: System.InvalidCastException: [A]Umbraco.Web.PublishedContentModels.UsnglobalSettings cannot be cast to [B]Umbraco.Web.PublishedContentModels.UsnglobalSettings. Type A originates from 'AppWeball.generated.cs.8f9494c4.nefr6y-y, Version=0.0.0.2, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'D:\local\Temporary ASP.NET Files\root\5b01a537\da008739\AppWeball.generated.cs.8f9494c4.nefr6y-y.dll'. Type B originates from 'AppWeball.generated.cs.8f9494c4.ye-ur5eg, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'D:\local\Temporary ASP.NET Files\root\5b01a537\da008739\AppWeball.generated.cs.8f9494c4.ye-ur5eg.dll'.
Stack: [InvalidCastException: [A]Umbraco.Web.PublishedContentModels.UsnglobalSettings cannot be cast to [B]Umbraco.Web.PublishedContentModels.UsnglobalSettings. Type A originates from 'AppWeball.generated.cs.8f9494c4.nefr6y-y, Version=0.0.0.2, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'D:\local\Temporary ASP.NET Files\root\5b01a537\da008739\AppWeball.generated.cs.8f9494c4.nefr6y-y.dll'. Type B originates from 'AppWeball.generated.cs.8f9494c4.ye-ur5eg, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'D:\local\Temporary ASP.NET Files\root\5b01a537\da008739\AppWeball.generated.cs.8f9494c4.ye-ur5eg.dll'.] ASP.PageViewsPartialsUSNWebsiteHeadSectionUSNWebsiteLogocshtml.Execute() in d:\home\site\wwwroot\Views\Partials\USNWebsiteHeadSection\USNWebsiteLogo.cshtml:4 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198 System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +90 System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +256 System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107 Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +113 System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) +277 System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +91 System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model) +33 ASP.PageViewsUSNAdvancedPagecshtml.Execute() in d:\home\site\wwwroot\Views\USNAdvancedPage.cshtml:16 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) +256 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) +290 System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +56 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList1 filters, ActionResult actionResult) +52 System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +173 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100 System.Web.Mvc.Async.WrappedAsyncResult
1.CallEndDelegate(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36 System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +22 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9748665 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +159Any help/guidance would be much appreciated
Hi Andy,
Refreshing your page should result in no error. I have seen this happen when you hit a page before models builder has finished generating the classes.
Cheers,
Marc
is working on a reply...