如何在 Sharepoint 2010 中将资源部署到 Hive
我读过很多关于它的示例和教程。但对于我的情况,这些所谓的解决方案都没有帮助我。
问题: 我有多个使用相同资源文件的 Web 部件,因此有一个针对资源文件的解决方案,该解决方案具有到资源的映射文件夹,其中包含 resx 文件。
当我将 resx 文件的“构建操作”属性设置为“嵌入”或“无”进行部署时,资源不会部署到 Hive/资源。
当我将“构建操作”设置为“内容”进行部署时,会部署资源,但使用资源的 Web 部件会出现以下错误:
找不到任何资源 适合特定文化 或中立文化。确保 “ResourceWp.Resources.ListNames.resources” 已正确嵌入或链接到 编译时程序集“ResourceWp”, 或者所有卫星组件 所需的可加载且完全 已签署。
这是我最后一根健康的神经无法抗拒疼痛的地方。我想像任何简单的 asp.net web 应用程序一样使用文化中立的 resx 文件。我认为这里有一些非常简单的东西,但由于我缺乏对程序集用法的了解,我错过了一些东西。
通过所有阅读,我只是无法理解一点,如果我能够使用像 super.resx 这样的资源文件而不编写 super.en-US.resx (我的意思是中性)。
因为我唯一的区别是这一点,我不使用任何 tr-TR 或类似的文化标识符,并且我在安装的土耳其语语言包和通过选择“土耳其语”作为语言创建的网站中使用此项目。
但在我看来,这不应该是重点,对吧?
摘要: 我想将我的资源部署在 Hive/Resources 中,并且它们可供我
尝试过的 Web 部件使用:
- http://johanleino.wordpress.com/2010/11/08/working-with-resource-files-in-sharepoint-2010/
- http://weblogs.asp.net/jevgeni/archive/2010/02/02/using-resource-files-in-sharepoint-2010-and-visual-studio-2010.aspx
种方法。但并没有与他们取得任何成功。
我希望,有人可以帮助我,提前致谢。
I've read a lot of examples and tutorials about it. But none of the so called solutions helped me in my case.
Problem:
I have multiple web parts using the same resource files, so there is a solution for resource files that has a mapped folder to Resources with resx files in it.
When I deploy with resx file's "build action" property set to embedded or none, resources are not deployed to Hive/Resources.
When I deploy with "build action" set to "content", resources are deployed but the webparts that use resources get the error below:
Could not find any resources
appropriate for the specified culture
or the neutral culture. Make sure
"ResourceWp.Resources.ListNames.resources"
was correctly embedded or linked into
assembly "ResourceWp" at compile time,
or that all the satellite assemblies
required are loadable and fully
signed.
This is the place where my last healthy nerves couldn't resist the pain. I want to use the resx file neutral in culture like any simple asp.net webApp. I think something really simple is here that I'm missing because of my lack of knowledge about the assembly usage.
Through all the reading, I just couldn't understand one point that if I am able to use resource files like super.resx without writing super.en-US.resx (neutral I mean).
Because only difference that I have is this point, I don't use any tr-TR or likewise culture identifier and I use this project in a Turkish language-pack installed and in a site created by selecting "Turkish" as language.
But in my opinion, that shouldn't be the point, right?
Summary:
I want to deploy my resource in Hive/Resources and them to be available to my webparts
I have tried:
- http://johanleino.wordpress.com/2010/11/08/working-with-resource-files-in-sharepoint-2010/
- http://weblogs.asp.net/jevgeni/archive/2010/02/02/using-resource-files-in-sharepoint-2010-and-visual-studio-2010.aspx
kind of approaches. But didn't accomplish any success with them.
I hope, someone can help me, thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来有必要将资源文件放在App_GlobalResources文件夹中。这种方法在我的(类似)案例中效果很好: https://sharepoint.stackexchange .com/questions/20851/localizing-asp-markup-in-webpart-issue
It seems as it is necessary to place the resource files in App_GlobalResources folder. This approach worked well in my (similar) case: https://sharepoint.stackexchange.com/questions/20851/localizing-asp-markup-in-webpart-issue