找不到任何资源指定区域性或中性文化 [英] Could not find any resources for the specified culture or the neutral culture

查看:344
本文介绍了找不到任何资源指定区域性或中性文化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要尝试这个例子中使用internatinalization。

I have to try to use internatinalization with this example.

http://afana.me/post/aspnet-mvc-国际部分,2.aspx

不过,我得到这个问题。

But I obtain this problem

找不到适合指定区域性或中性文化的任何资源。确保Resources.Resources.resources正确​​嵌入或在编译时链接到程序集​​资源,或者确保所有需要的附属程序集都可加载并完全签名。

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Resources.Resources.resources" was correctly embedded or linked into assembly "Resources" at compile time, or that all the satellite assemblies required are loadable and fully signed.

我要寻找一个在谷歌的solucion,但我不明白solucion。

I am looking for the solucion in google, but I dont understand the solucion.

创建我的资源,这样的..

I create my resources like this..

右键单击该解决方案,然后选择添加 - >新建项目上下文菜单命令。选择类库项目类型,并命名为资源。
现在,右键点击资源项目,然后选择添加 - >新建项目上下文菜单命令。选择资源文件并命名为Resources.resx

Right click on the Solution and then choose the "Add->New Project" context menu command. Choose "Class Library" project type and name it "Resources". Now right click on "Resources" project and then choose "Add->New Item" context menu command. Choose "Resource File" and name it "Resources.resx"

我在其他的例子看,人们在这个文件App_GlobalResources文件创建资源,这是我的错误???

I read in other example that people create the resources in this file App_GlobalResources, this is relation with my error???

推荐答案

我意识到这是一个老问题,但在情况下,它可以帮助别人搜索这里>>>

I realise this is an old question, however in case it helps anyone else searching here >>>

您需要设置的.resx建设行动嵌入式资源它与数据注释在这个例子中工作。当您添加的.resx到App_LocalResources文件夹生成操作将被设置为默认的内容。

You need to set the .resx build action to "Embedded resource" for it to work with Data Annotations as in that example. When you add a .resx to an App_LocalResources folder the build action will be set to Content by default.

此外,在上面的例子中,你把它添加到其他项目,因此请确保访问修饰符也被设置为公开(双击.resx文件打开文件和访问修饰符沿位于上方编辑器窗口)。

Also, in your example above, you added it to another project, so ensure that the Access Modifier is also set to "Public" (double click the .resx file to open the file and the Access Modifier is located along the top of the editor window).

此外,还应确保您从主应用程序添加到资源项目的引用。

Also ensure that you add a reference to the resources project from your main application.

这篇关于找不到任何资源指定区域性或中性文化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆