Copied to clipboard

Flag this post as spam?

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


  • Mike Cave 24 posts 162 karma points
    Feb 09, 2018 @ 12:12
    Mike Cave
    0

    Archetype and umbraco.web.PublishedContentModelsThe error:

    Hi Guys, me again....

    I have an inherited project with Umbraco in. It is not a runnable .net project.

    I have just plugged in Archetype into the Umbraco back end an I'm following a tutorial to get a page up and running.

    the back end is all done and I'm in Razor code putting in the partial, which is fine, and now I'm adding code to the template.

    The tutorial is running Archetype 1.5 and I'm running the latest 1.8.

    in the template I have put in : @using ContentModels = Umbraco.Web.PublishedContentModels;

    but the page falls over saying I'm missing an assembly reference.

    I cant build the project, so I am not sure if the PublishedContentModels; is part of my version of umbraco/Archetype.

    The error:

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0234: The type or namespace name 'PublishedContentModels' does not exist in the namespace 'Umbraco.Web' (are you missing an assembly reference?)

    Source Error:

    Line 3: @using Umbraco.Core.Models; Line 4: @using Archetype.Extensions Line 5: @using ContentModels = Umbraco.Web.PublishedContentModels; Line 6:


    I have looked around and people have suggested the reference needs to be either added or deleted from the Web config:

    add namespace="Umbraco.Web.PublishedContentModels"

    I tried both (I had to add it in as it wasnt present) but no joy. Has the reference changed in my version of umbraco? As my project is not runnable (grr) I cant build the code , so I am not sure how to proceed.

    Again, any help is very much appreciated.

    thanks

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Feb 09, 2018 @ 12:26
    Dan Diplo
    0

    Me again :)

    I don't think you need any reference to PublishedContentModels for Archetype to work. I believe they are only needed for Umbraco Models Builder. So just remove the @using statement. If your tutorial needs them, then it's probably not just a pure Archetype solution.

    You can find the official docs for Archetype at: https://github.com/kgiszewski/ArchetypeManual

    Have a look at: https://github.com/kgiszewski/ArchetypeManual/blob/master/03%20-%20Template%20Usage.md for getting content out.

  • Mike Cave 24 posts 162 karma points
    Feb 09, 2018 @ 13:01
    Mike Cave
    0

    Hi Dan,

    that was the trick, I now have the data from Archetype spitting out to my page, now to dress it up.

    thansk so much for your help over the last few days, I would be in Frustration City with out it!

    Best regards,

    Mike

  • Mike Cave 24 posts 162 karma points
    Feb 09, 2018 @ 12:50
    Mike Cave
    0

    :-)

    Hi Dan, Thanks very much for your prompt reply, you have been a great help.

    I will have a look at the docs again and check out the Manual

    Thanks again!

    Mike

Please Sign in or register to post replies

Write your reply to:

Draft