开发者

reading a string from resx file sharpdevelop c#

开发者 https://www.devze.com 2023-01-08 07:53 出处:网络
I\'m writing a class 开发者_运维技巧library in C# using sharp develop. I am including an resx(resource) file which contains some string values. I\'m using the following code:

I'm writing a class 开发者_运维技巧library in C# using sharp develop. I am including an resx(resource) file which contains some string values. I'm using the following code:

ResourceManager rm = new ResourceManager("ResourceFileName",this.GetType().Assembly);
string str=rm.GetString("Keyname");

It compiles fine. At run time, it gives me the following error:

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

The question is that is it not possible to use resx file in Sharpdevelop?? If yes, then how to resolve this problem.

Thanks and Regards,

Vamyip


In the first argument use full name of resource class "namespace.classname" in secound argument

 Assembly.GetExecutingAssembly()
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号