Cannot bind source content type Umbraco.Web.PublishedCache.NuCache.PublishedContent to model type Foo.PublishedContentModels.Home.
I've just deployed my site to Azure, and published my database using SSMS' Deploy Database to Microsoft Azure SQL Database feature. Both completed successfully. I can log into umbraco and see all the content I had locally on the Azure site but when I try to hit the homepage I get a YSOD with the error below. What's happening? What am I missing?
Server Error in '/' Application.
Cannot bind source content type Umbraco.Web.PublishedCache.NuCache.PublishedContent to model type Foo.PublishedContentModels.Home.
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: Umbraco.Web.Mvc.ModelBindingException: Cannot bind source content type Umbraco.Web.PublishedCache.NuCache.PublishedContent to model type Foo.PublishedContentModels.Home.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ModelBindingException: Cannot bind source content type Umbraco.Web.PublishedCache.NuCache.PublishedContent to model type Foo.PublishedContentModels.Home.]
Umbraco.Web.Mvc.ContentModelBinder.ThrowModelBindingException(Boolean sourceContent, Boolean modelContent, Type sourceType, Type modelType) in D:\a\1\s\src\Umbraco.Web\Mvc\ContentModelBinder.cs:159
Umbraco.Web.Mvc.ContentModelBinder.BindModel(Object source, Type modelType) in D:\a\1\s\src\Umbraco.Web\Mvc\ContentModelBinder.cs:94
Umbraco.Web.Mvc.UmbracoViewPage`1.SetViewData(ViewDataDictionary viewData) in D:\a\1\s\src\Umbraco.Web\Mvc\UmbracoViewPageOfTModel.cs:152
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +99
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) in D:\a\1\s\src\Umbraco.Web\Mvc\ProfilingView.cs:25
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +291
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
What I'd done is disabled modelsBuilder with a config transform going to Azure without realizing this disables the Model Binder as well as Model Builder:
Cannot bind source content type Umbraco.Web.PublishedCache.NuCache.PublishedContent to model type Foo.PublishedContentModels.Home.
I've just deployed my site to Azure, and published my database using SSMS' Deploy Database to Microsoft Azure SQL Database feature. Both completed successfully. I can log into umbraco and see all the content I had locally on the Azure site but when I try to hit the homepage I get a YSOD with the error below. What's happening? What am I missing?
(Cross posted on stackoverflow.)
Error:
Got it,
What I'd done is disabled modelsBuilder with a config transform going to Azure without realizing this disables the Model Binder as well as Model Builder:
What I really wanted to do was leave
Umbraco.ModelsBuilder.Enable == true
and setUmbraco.ModelsBuilder.ModelsMode == Nothing
:This works as expected.
is working on a reply...