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.
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?
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.
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...
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:
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?
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?
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?
<umbraco:Macro runat="server" Language="razor" Cache="0">
@using umbraco.MacroEngines;
</umbraco:Macro>
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
Very strange, might've been a corrupt or missing file somewhere. It happens sometimes. Glad it's working for you now though!
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!!
is working on a reply...