Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matthew Watts 5 posts 76 karma points
    Feb 13, 2022 @ 19:25
    Matthew Watts
    0

    Umbraco 9 models not being generated

    I have created a new starter project and then cloned from the Live cloud version of Umbraco. When I clone and then run the project locally I get the following error. I believe it relates to the models not being generated:

    The type or namespace name 'Home' does not exist in the namespace 'Umbraco.Cms.Web.Common.PublishedModels' (are you missing an assembly reference?) + public class Views_home : Umbraco.Cms.Web.Common.Views.UmbracoViewPage

    I have tried changing the configuration for the models

    "ModelsBuilder": { "ModelsDirectory": "~/models-builder/generated", "Enable": true, "ModelsMode": "SourceCodeAuto", "AcceptUnsafeModelsDirectory": true },

  • Ambert van Unen 175 posts 817 karma points c-trib
    Feb 15, 2022 @ 15:43
    Ambert van Unen
    0

    Are there models in your ~/models-builder/generated folder ?

    If not, then you need to go in the backoffice and run the modelsbuilder on the Settings page, that should generate your models in the specified folder for you.

  • Matthew Watts 5 posts 76 karma points
    Feb 15, 2022 @ 20:43
    Matthew Watts
    1

    No the folder was empty and the option to generate the models in the settings page was disabled.

    I have managed to fix the issue. I cloned the solution from Git again but did it to the 'Documents' area rather and opened Visual Studio as admin. Now the models are being generated. So not sure if it was a permissions issue.

Please Sign in or register to post replies

Write your reply to:

Draft