Copied to clipboard

Flag this post as spam?

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


  • Greg Berlin 818 posts 634 karma points
    Mar 05, 2013 @ 03:32
    Greg Berlin
    0

    Umbraco 6 Fresh Install - CS0234: The type or namespace name 'Cms' does not exist in the namespace 'Umbraco'

    I've got this issue on a fresh Version 6 Install.  Installed from the binary.

    Error is:

     Error occured

    c
    :\DEVELOPMENT\Sites\despangler.local\WEB\macroScripts\634979334878453971_verb_conjugation_overview.cshtml(2): error CS0234: The type or namespace name 'Cms' does not exist in the namespace 'Umbraco' (are you missing an assembly reference?)

     

    A razor script with just the following:

    @inherits PartialViewMacroPage

     

    Throws this error:

    Error occured
    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a17adf73\5eaf38dc\App_Web_634979339575648376_verb_conjugation_overview.cshtml.70df5e80.uhjl3jj1.0.cs(29): error CS0246: The type or namespace name 'PartialViewMacroPage' could not be found (are you missing a using directive or an assembly reference?)

     Any idea what is wrong?  

    Thanks, Greg

  • Owen 123 posts 246 karma points
    Mar 05, 2013 @ 04:36
    Owen
    1

    Missing the namespace, the full name should be "Umbraco.Web.Macros.PartialViewMacroPage"

  • Greg Berlin 818 posts 634 karma points
    Mar 05, 2013 @ 22:37
    Greg Berlin
    0

    Thanks Owen, a decent suggestion but that's not it.  The main issue seems to be with the Umbraco.Cms namespace (I still get the first error mentioned with the following code):

    @inherits PartialViewMacroPage
    @using Umbraco.Cms.Web
    @using Umbraco.Cms.Web.Macros
    @using Umbraco.Framework
     
     
    @* Ensure that the Current Page has children *@
    @if (CurrentPage.Children.Any())
    {

     

    This is what was in the "List Descendants from Current Page" template.  I'm guessing this is wrong for V6..  Are there any Razor guides for V6 anywhere?  I've tried to poke around in some of the binaries included in V6 and can't find the namespaces mentioned above... can somebody point me in the right direction, please?

  • Greg Berlin 818 posts 634 karma points
    Mar 05, 2013 @ 23:09
    Greg Berlin
    100

    Okay, fixed.  The template should not have had the 3 using statements at the top, and it should have inherited

    @inherits umbraco.MacroEngines.DynamicNodeContext

    instead of 

    @inheritsPartialViewMacroPage

     

    Also, it should reference Model instead of CurrentPage.

    Perhaps a core developer would like to fix the templates in V6??

Please Sign in or register to post replies

Write your reply to:

Draft