强类型资源会导致问题吗?
在一些重构过程中,我将资源文件从一个项目移动到另一个项目。 我想我点击了一个警告,告诉我在某一时刻强烈键入资源文件,现在我得到:
找不到任何资源 适合特定文化 或中立文化。 确保 “MyProject.Common.ResourceManagement.resources” 已正确嵌入或链接到 编译时程序集“MyProject.Common” 时间,或者说所有的卫星 所需的组件是可加载的并且 已完全签署。
我相信这是来自 MissingManifestResourceException 。
http://msdn.microsoft.com/en-us/ Library/system.resources.missingmanifestresourceexception.aspx
我查找了几个解决方案:
- http://weblogs.asp.net/ngur/archive/2003/12/28/46219.aspx
- http://jameswho.blogspot.com/2004/06/missingmanifestresourceexception.html
- http://support.microsoft.com/kb/318603
但它们似乎都与我的情况无关。
有任何想法吗? 这已经困扰我好几天了。
我是不是在做蠢事?
In the middle of some refactoring and I've moved a resources file from one project to another. I think I clicked a warning telling me to Strongly type the resource file at one point and now I'm getting:
Could not find any resources
appropriate for the specified culture
or the neutral culture. Make sure
"MyProject.Common.ResourceManagement.resources"
was correctly embedded or linked into
assembly "MyProject.Common" at compile
time, or that all the satellite
assemblies required are loadable and
fully signed.
Which is from a MissingManifestResourceException I beleive.
http://msdn.microsoft.com/en-us/library/system.resources.missingmanifestresourceexception.aspx
I've looked up a couple of the solutions:
- http://weblogs.asp.net/ngur/archive/2003/12/28/46219.aspx
- http://jameswho.blogspot.com/2004/06/missingmanifestresourceexception.html
- http://support.microsoft.com/kb/318603
But none of them seem relevant to my situation.
Any ideas? This has been bugging me for a few days now.
Am I doing something stupid?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您确定这些资源文件已嵌入到程序集中吗? 也许您在移动文件时丢失了“嵌入式资源”设置。
此外,资源名称可能已更改。 资源的完全限定名称是
程序集名称 + 物理子文件夹 + 资源名称
Are you sure these resource files are embedded into the assembly? Maybe you've lost the "Embedded Resource" settings as you moved the files.
Further, the resource names may have changed. The fully qualified name of a resource is
AssemblyName + physical subfolder(s) + resource name
您可以将它们从原始项目导出到文本文件并导入到新项目中吗? 如果它只是键/值对,那么它应该很简单。
Can you export them to a text file from the original project and import them into the new project? If it's just key/value pairs it should be simple.