HOME

Wow Files

Main Page

Availability
 

Resource files (.resx, .resource) can be compiled into an assembly or put into their own assembly as a satellite resource. When compiled into an app, you’re stuck with what you have at compile time, but that’s not a problem if you’re simply wrapping up something that won’t change between builds. International satellite assemblies require special consideration, but the support for them in the runtime is very cool and invaluable if the need arises.

Creating a resource file
In my specific case, I found that my error messages were long enough to make my code look messy and decreased the readability. Simply putting the error messages into a local resource file (compiled with the assembly) made the code much easier to follow.

You can add a resource file via the "Add Item…" item in the Solution Explorer. When you open the file, you’re presented with VS.NET’s XML editor, as the resx format is a simple XML document. The columns presented are Name, Value, Comment, Type and MimeType. When using strings, you only need to be concerned with the Name and Value columns.

  

   
Z&T