Hello,

I'm building a generic Class Library that I will use it in all my projects.

However, I want to know how can I access Resource file from a Class Library ?

I will appreciate if you can send me a code sample!

Thank you for your help

Paul

Is the resource part of the class library?

Yes the resource should be part of the Class Library.

As for now, I can do the following where I have only only Resource file Resources.resx: LibAEM.Properties.Resources.ResourceManager.GetString("RecordType_Missing").ToString() where LibAEM is the name of my Class Library.

I have already worked on a Website Project where we can create our classes under App_Code Folder (e.g. App_Code/CCustomer.cs), and then we can create all related Resouces File under App_GlobalResources (e.g. App_GlobalResources/CCustmomers.resx or App_GlobalResources/CCustmomers.fr.resx ... ) . And we can acces the resouces files by doing the following: Resources.CCustomers.FirstName_Missing.ToString()


So I would like to know if there's a way to have a resource file for each class inside my Class Library or something similar to what we have in a Website Project ?

Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.