【问题标题】:External References not referenced in Razor ViewRazor 视图中未引用的外部引用
【发布时间】:2011-03-10 05:30:01
【问题描述】:

我正在使用具有剃刀视图的 MVC3。 我正在尝试使用来自与 mvc3 项目不同的项目的模型, 其报告编译错误与

CS0246: The type or namespace name 'MyNameSpace' could not be found (are you missing a using directive or an assembly reference?)

正如一些other posts 中的回答,我尝试在 Views 文件夹中添加 @using 指令或编辑 web.config,但它仍然无法正常工作。

有人可以推荐一下吗。

【问题讨论】:

    标签: asp.net-mvc-3 reference razor


    【解决方案1】:

    我的项目缺少一个程序集。似乎添加引用还不够。

    【讨论】:

      【解决方案2】:

      正确,添加引用是不够的。它需要作为程序集添加到项目中,否则编译器将无法找到该库。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-03-23
        • 1970-01-01
        • 1970-01-01
        • 2017-08-20
        • 2011-06-29
        • 1970-01-01
        相关资源
        最近更新 更多