c# razor generator compile error with NancyFx project

182 Views Asked by At

First time ask question here hope sb can help me.

Background: I am using Vs2017 creating a c# mvc program with NancyFX based on .NET 4.6 . The program works find but I want to use razor generator to compile views (.cshtml) I install razor generator and generated .cs for all views.

When compile I got tons of errors saying: "The name 'Href' does not exist in the current context" in all generated.cs files.

If I remove first line "@inherits nancyRazorViewBase" from _layoutDefault I got error message "type expect".

Had been stuck in this for whole day.

Thanks for any tips.

------ update ---------

Now I am sure its sth wrong with the configuration, most likely web.config.

From the error message "Href ...." in generated.cs it says 'Href' can NOT be found. It is actually under assembly "system.web.webPages" . See iamge below: defination for Href

in index.generated.cs this assemble was referenced & using System.web.webpages. But you can see compile error. 261 compile errors

relevant setting in web.configure :3

0

There are 0 best solutions below