CandidContributions/CanConCloud

v8-9: ModelsBuilder

Closed this issue · 0 comments

v8: web.config

<add key="Umbraco.ModelsBuilder.Enable" value="true" />
<add key="Umbraco.ModelsBuilder.ModelsMode" value="AppData" />
<add key="Umbraco.ModelsBuilder.AcceptUnsafeModelsDirectory" value="true" />
<add key="Umbraco.ModelsBuilder.ModelsDirectory" value="~/../CandidContribs.Core/Models/Published" />

v9: appsettings.json

We chose the 'SourceCodeAuto' mode. Read about the different modes in the official docs.

"Umbraco": {
    "CMS": {
      "Global": { ... },
      "Hosting": { ... },
      "ModelsBuilder": {
        "ModelsMode": "SourceCodeAuto",
        "ModelsDirectory": "../CandidContributions.Core/Models/Content",
        "AcceptUnsafeModelsDirectory": true
      }
    }
  }

Observations

In v9, if no ModelsDirectory is specified, the models are created in /umbraco/models in the web project. If you change your ModelsDirectory you will need to manually clear out that folder.