twreid
twreid

Reputation: 1453

ServiceStack Razor Views Compilation errors

Ok I have been looking at Razor Rockstars, but I created a layout described Physical Project Structure

I have my one view in the ServiceInterface dll and have it set to CopyIfNewer yet everytime I browse to localhost:5000\hello\name I get the below error:

HttpCompileException

And it says:

c:\Users\tyler.w.reid\AppData\Local\Temp\ayyw2jf2.0.cs(28): error CS0246: The type or namespace name 'ServiceModel' could not be found (are you missing a using directive or an assembly reference?)

I have made sure that the main exe and the ServiceInterface dll both have a reference to that project. I also added it to the app.config

<pages pageBaseType="ServiceStack.Razor.ViewPage">
        <namespaces>
            <add namespace="ServiceStack.Html" />
            <add namespace="ServiceStack.Razor" />
            <add namespace="ServiceStack.Text" />
            <add namespace="ServiceStack.OrmLite" />
            <add namespace="StudentTeachingManager" />
            <add namespace="StudentTeachingManager.ServiceModel" />
            <add namespace="StudentTeachingManager.ServiceModel.Types" />
        </namespaces>
    </pages>

Can anyone offer some advice on what to do next?

Upvotes: 2

Views: 293

Answers (1)

Spaceman
Spaceman

Reputation: 1339

I had an issue that was similar to this recently i think:

Razor “The type or namespace name 'x' could not be found” Error. Compile Only

I had to ensure the dll was loaded not just referenced at the time that razor compiled.

Try in the global App start function to call anything at all (a static method call ping that did nothing is what I used) from the dll that is throwing the error.

Upvotes: 2

Related Questions