我有一个使用声明的Nancy视图:
@using System.Xml
@{ //code
}
<!-- rest of page -->
我的项目中引用了System.Xml。
当我尝试运行应用程序时,我收到了Razor编译错误:
Error compiling template: Views/index.cshtml
Errors:
[CS0234] Line: 1 Column: 18 - The type or namespace name 'Xml' does not exist in the namespace 'System' (are you missing an assembly reference?) (show)
Details:
@using System.Xml
其他名称空间,例如System.Web也以相同的方式失败,即使它们包含在项目中。
想法?
答案 0 :(得分:1)
这看起来像是不配置剃须刀的经典案例。
https://github.com/NancyFx/Nancy/wiki/Razor-View-Engine#configuring-razor