Sunday, September 18, 2005

Right-click on the project to which you want to add a Resx file and click on Add\Add New Item.

Choose Assembly Resource File.

Click on Open.

Select the data in the left pane and then click on the name column in the right pane.

Enter a name.

Enter a value.

Note that this method embeds the resource file within the current project's assembly file. In a way, the assembly is a resource assembly; although you can use the project's assembly for more than just serving resources. Upon compilation, the contents of the resource file are embedded into the project's assembly MSIL.

Creating a Resx resource assembly is pretty much the same as that outlined in Creating Resx Files in VS.NET (embedding resources) above with the exception being the embedded resource is not part of the current project (the project accessing the resource(s)).

To create an assembly resource that uses a resources (binary) file: Use the steps outlined above, only instead of adding a Resx file, create a .resources file using the ResEditor utility. You should be able to find this utility in "%PROGRAMFILES%\Microsoft Visual Studio .NET 2003\SDK\v1.1\Samples\Tutorials\resourcesandlocalization\reseditor".

To access the resources of the resource assembly: perform the same steps as above.