在MVC应用程序中无法访问Resources文件夹

时间:2013-09-13 09:56:44

标签: asp.net-mvc visual-studio-2010

我在MVC 3中创建了一个应用程序并添加了一个文件夹[Resources]。 文件夹包含.resx文件。但是当我在视图中使用.resx文件时,没有智能感知 和编译器抛出一个错误=>

CS0234: The type or namespace name 'Resources' does not exist in the namespace 'MyApp.web' (are you missing an assembly reference?)

我在view =&gt;中使用它<h1>@MyApp.web.Resources.Index.Heading</h1>

index = Resx文件名称,标题= KeyName

1 个答案:

答案 0 :(得分:1)

资源类型必须是公开的(访问修饰符选项设置为公开

相关问题