Copied to clipboard

Flag this post as spam?

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


  • Christian Stenfors 80 posts 124 karma points
    Jul 29, 2011 @ 22:12
    Christian Stenfors
    0

    strange razor error - Error loading Razor Script

    First off, let me just say, that i am quite new to razor.

    That sayd, i have been following the video-tuts on Umbraco TV on how to get started with razor, and everything was going just fine, until i started getting this error:

    Error loading Razor Script
    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\.......error CS0138: A using namespace directive can only be applied to namespaces; 'umbraco.MacroEngines.ExtensionMethods' is a type not a namespace

    I have no idea why i am starting getting this error. It is a Umbraco 4.7 running on framework 4 on a ISS 7.

    Hope that somebody out there can help me out?

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Aug 01, 2011 @ 13:14
    Sebastiaan Janssen
    0

    Do you have a using statement in your Razor script that is refereing to umbraco.MacroEngines.ExtensionMethods? ExtensionMethods is indeed not a namespace so you'll have to use a "using umbraco.MacroEngines;".

    If that's not it, could you provide a codesample so we can have a look?

  • Christian Stenfors 80 posts 124 karma points
    Aug 03, 2011 @ 16:03
    Christian Stenfors
    0

    Hi Sebastiaan,

    no i don't have a using-statement like that in my razor script.

    Actually, since i am just setting this site up so i can start playing around with, and getting to know razor, i haven't really done anything other than to include a inline macro to write razor statements in. And it seems that no matter what i write in that script section, this error comes out.

    Do you have any idea why?

  • kaushal 5 posts 25 karma points
    Aug 11, 2011 @ 11:00
    kaushal
    0

    <umbraco:Macro runat="server" Language="razor" Cache="0">

    @using umbraco.MacroEngines;

    </umbraco:Macro>

  • Christian Stenfors 80 posts 124 karma points
    Nov 18, 2011 @ 10:47
    Christian Stenfors
    0

    I never figured out what was wrong, but i guess that it was specific to just that website, because i have websites that i configurated the same way now, that works...

    stranger

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Nov 18, 2011 @ 10:49
    Sebastiaan Janssen
    0

    Very strange, might've been a corrupt or missing file somewhere. It happens sometimes. Glad it's working for you now though!  

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 21, 2012 @ 19:31
    Fuji Kusaka
    0

    Hi Guys am having the same issue, cant figure out how to get my razor file saved. Even a blank file wont saved.

    What is really weird is having another website running with v 4.7.0 and yet no errors!!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies