views:

259

answers:

2

I have a solution with one web project and one class library. In web project I have App_GlobalResources folder with resource file. In code used in web project I can access resourcel like this: string r = Resources.res.ResourceString123;

How to get this resource string from class library?

A: 

In .net 2.0, you will need to add the InternalsVisibleTo attribute to the assembly & set it to the namespace which needs to access the file:

MSDN: http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx

Another options could be to create a class in the class library which can return the strings you need...

HTH.

Sunny
A: 

If using visual studio 2008 you can set the access modifier on the Resource designer to public in the class library.

Aaron Carlson