Menu

Post image 1
Post image 2
1 / 2
0

Bootstrapping Umbraco ModelsBuilder on an empty site

DEV Community·Sebastiaan Janssen·26 days ago
#qbt9POwM
#claude#dotnet#tutorial#webdev#models#umbraco
Reading 0:00
15s threshold

The rest of this post was written with Claude AI. Here's the simple problem I seem to get myself into often: I have views that need a strongly typed model, but modelsbuilder hasn't put the models on disk so Umbraco completely fails to start. dotnet run just fails 😱 But I need to get into the backoffice to generate the models; difficult when Umbraco doesn't even run. After I encountered this today, I finally took some time to figure out what the easiest way is to get this fixed. What follows is the summary of what Claude did for me: Dropped a set of strongly-typed views ( home.cshtml , Author.cshtml , etc.) into a fresh Umbraco site and ran straight into the chicken-and-egg problem every Umbraco developer eventually meets: The views reference Umbraco.Cms.Web.Common.PublishedModels.Home (and friends). Those classes are generated by ModelsBuilder from document types that live in the database. The database is empty until the site has run at least once.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More