Small Features are Cool Too!

Small Features are Cool Too!

This evening I was taking a look at some of the additional options in the Project Properties dialog in Visual Studio 2008 Beta 2 and noticed that there was an additional dropdown on the Resources page.  The Access Modifier dropdown with options Friend and Public (in conflict with the documentation which states there should also be a No code generation option) allows you to control the accessibility of the project resources.

image

So, how does this look in practice?  Well, assume that this TestResource string resource is defined in a project called ReferencedLibrary. Now to access this resource from within this assembly you would write:

My.Resources.TestResource

To access this resource from another assembly that references this project you would write:

ReferencedLibrary.My.Resources.TestResource

This option requires the Access Modifier property to be set to Public. Not sure if I agree with access modifiers for resources being set at a project level – think I would prefer to see this property set on  a resource by resource basis but hey, this is a small but cool improvement!

Leave a Reply

Your email address will not be published. Required fields are marked *