Euclid
Euclid

Reputation: 910

How do i use a Resources.resx in a C# class?

i am currently using this line of code

resourceManager = new ResourceManager("Namespace.class", GetType().Assembly);



to try use a resourse but keep getting a error:
System.Resources.MissingManifestResourceException was unhandled

i am just trying to use the default .resx file made by VS2008

Upvotes: 1

Views: 5670

Answers (2)

Lex Li
Lex Li

Reputation: 63264

http://www.codeproject.com/KB/dotnet/ResXFileCodeGeneratorEx.aspx

You don't need to initiate your own ResourceManager, as Visual Studio ResXFileCodeGenerator already does that for you.

Upvotes: 1

joerage
joerage

Reputation: 4923

The class is created using static members.

Usually, you reference it like this:

Resources.ResourceClassName.ResourceName

Check the xxx.designer.cs file to know the namespace and class name to use.

Upvotes: 2

Related Questions