资源文件找不到 Could not find any resources appropriate for the specified culture or the neutral culture.

来源:互联网 发布:中国电信oa软件 编辑:程序博客网 时间:2024/06/01 07:59

错误:

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

 

例如我们有一个Strings.resx作为embed resource.

 

在vs 2010里可以用如下代码读取资源文件:

 

rm = new ResourceManager("Strings",  Assembly.GetExecutingAssembly() );

 

但是在之前版本有可能会不行,我在vs2008下不行,找了找原因现记录下来:

MyApplication.MyClass是当前类的命名空间

rm = new ResourceManager("MyApplication.MyClass.Strings",  Assembly.GetExecutingAssembly() );

 

it works now!