如何在 Sharepoint 2010 中将资源部署到 Hive

发布于 2024-11-06 16:17:09 字数 1420 浏览 0 评论 0原文

我读过很多关于它的示例和教程。但对于我的情况,这些所谓的解决方案都没有帮助我。

问题: 我有多个使用相同资源文件的 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 部件使用:

种方法。但并没有与他们取得任何成功。

我希望,有人可以帮助我,提前致谢。

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:

kind of approaches. But didn't accomplish any success with them.

I hope, someone can help me, thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乖乖兔^ω^ 2024-11-13 16:17:09

看来有必要将资源文件放在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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文