Mike Nichols - Son of Nun Technology

Global Resources In Visual Studio 2005

What is the best way to implement resources (ie., strings) across an entire application in VS 2005?

Managing resources in VS 2005 per project is a snap with the ResXFileCodeGenerator being built in but the strong-typed references are marked 'internal', limiting their visibility to that project's code.

One solution I am considering is simply having a project (class library) that will only house things like Strings resource files (ie., "Strings.resx") and contain NO CODE. Then I add the InternalsVisibleTo attribute in my AssemblyInfo.cs file for each Project in my app that wants to consume these strings.

This is a common requirement for things like Exception messages and so on that would need to be accessed across all projects. It still feels like a hack to me, tho, using the InternalsVisibleTo attribute. Is there a better way of doing this without having to implement a build script that copies my .resx into each assembly in my solution?

I can only find examples where the resources are all reference from within their own assembly.

While writing this blog I typed "ResXFileCodeGenerator" in google and Ayende blogged about this, too. I thot "WOO HOO! He'll tell me! He is the Guy Who Knows Alot :)". But alas I couldn't find how he resolved it .

Now I found this tool at Gokhan's blog that will (hopefully) resolve this. Ironically, he just updated this only last week...let's see how it goes ...

Does anyone else think it is annoying that the MS tool doesn't have this option baked in already? This kind of requirement seems like it would be too common to overlook...