Copied to clipboard

Flag this post as spam?

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


  • Charles 3 posts 83 karma points
    Nov 15, 2021 @ 14:11
    Charles
    0

    Umbraco 9 - Unable render view with model

    Hi,

    I have enabled the models builder, ModelsMode = SourceCodeAuto.

    Currently I have created a Document type named as Home and published a page named as Home as well.

    However, I got the below message when I view my page. The type or namespace name 'Home' does not exist in the namespace 'Umbraco.Cms.Web.Common.PublishedModels' (are you missing an assembly reference?)

    Here is how I call the model. @using Umbraco.Cms.Web.Common.PublishedModels; @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage

  • Kevin Meilander 78 posts 384 karma points c-trib
    Nov 16, 2021 @ 00:34
    Kevin Meilander
    100

    Assuming you see the source code file, try rebuilding your project after you generated the model class. You may also need to restart your website instance so it can get the updates.

    That always trips me up.

  • Charles 3 posts 83 karma points
    Nov 16, 2021 @ 12:35
    Charles
    0

    Hi Kevin,

    Yes, it works after I rebuild my project.

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft