Copied to clipboard

Flag this post as spam?

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

  • Mats Lidström 3 posts 93 karma points
    Aug 25, 2019 @ 08:02
    Mats Lidström

    The type or namespace name 'Home' could not be found

    I just installed a fresh Umbraco with the Clean starter kit and I get this in the error list. It's at line 4 in mainNavigation.cshtml.

    var homePage = Model.AncestorOrSelf<Home>();

    Despite these errors the site compiles and runs so it's only the editor that can't find it. The compiler is fine.

    Anyone got a solution to this?

  • Shaishav Karnani from 354 posts 1638 karma points
    Aug 25, 2019 @ 13:57
    Shaishav Karnani from

    Hi Mats,

    It seems your ModelBuilder has not generated the Model. So, it is not able to get Home class.

    Under Settings Section -> Model Builder Tab will show Model Builder is enabled and where Model files have been created.

    Please can you check and confirm.



  • Mats Lidström 3 posts 93 karma points
    Aug 26, 2019 @ 16:53
    Mats Lidström

    Yes, Models Builder is enabled and running Pure Live. The files are there in App_Data/Models

    I found on this page that if you use Models Builder you can use @inherits Umbraco.Web.Mvc.UmbracoViewPage<HomePage> but that doesn't work for me. I get the red "wiggly line" under HomePage on that line. The type or namespace could not be found.

    Could you give me some code that you know should work so I can do more tests?

  • Mats Lidström 3 posts 93 karma points
    Aug 26, 2019 @ 17:45
    Mats Lidström

    Ok I found the solution:

    If you want Visual Studio to know about your models, they do need to exist in a proper DLL so the correct solution is indeed to go for value="Dll" and generate the DLL.

    I think that would be one of the first lines in the tutorial :D

  • Biagio Paruolo 1599 posts 1830 karma points c-trib
    Sep 12, 2019 @ 13:21
    Biagio Paruolo

    Strange. I've similar problem on a fresh and clean Umbraco 8.1.4 installation with Umbraco Starter kit, Bulma Starter kit and another one. Do it possible that they don't test on Umbraco 8.1.4?

  • Cedric 15 posts 86 karma points
    Oct 18, 2019 @ 07:59

    Hello, I have same probleme with Umbraco 8.2 and Model Builder not visible in back office best regards, Cédric

Please Sign in or register to post replies

Write your reply to: