1

我在 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?)

我在视图中使用它=> <h1>@MyApp.web.Resources.Index.Heading</h1>

index= Resx 文件名,Heading=KeyName

4

1 回答 1

2

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

于 2013-09-13T09:59:24.780 回答