Error creating new Umbraco 13 site using with Models Builder
01/27/2024, 12:51 PM
Can anyone shed any light on this... Whenever I create (via Visual Studio) a new Umbraco project (V13.1) and configure Models Builder (SourceCodeManual) I get the following error:
**An unhandled exception occurred while processing the request.
ModelBindingException: Cannot bind source content type Umbraco.Cms.Infrastructure.PublishedCache.PublishedContent to model type 'MyDocType'**
It happens on every new install (existing projects are fine) regardless of what I do. I can create a single simple doc type with 1 text property and no other doc types in the system and I get the error. Models are created successfully and I can see they're all correct in the source code if I switch the view page to use IPublishedContent the page works fine but as soon as I switch it to the generated model it throws an error. Also, I can do (IPublishedContent) Model as MyModelClass and this variable will be null.
All classes and namespaces are correct, no errors are listed in the error list, if I copy an existing project into this solution I get the same error, if I create a new solution from scratch I get the same issue I have tried everything I can think of