Resource file in class library

S

Sami Rehman

Hi,
I have got a C# Class library project 'MyCompany.Model.ValidationService'
that deals with
data validation. In this I have got a resource file 'RegularExpressions' to
store regular
expressions for email, tel no, SSN etc. Below is the code and associated
error message

Line1: ValidationResultList validationResultList = new
ValidationResultList();
Line2: ResourceManager rm = new ResourceManager("RegularExpressions",
this.GetType().Assembly);
Line3: string t= rm.GetString("Testing"); //throws error

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

I cant figure out what I am doing wrong, if it has trouble with locating or
loading the resource file then why doesnt line 2 throws error in the first
place.

Thanks.
-Sami
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top