views:

403

answers:

2

I was looking into embedding custom version strings using in assemblies a while back, and one approach that the documentation suggested was to embed a windows resource.

The only way I can see to create a windows resource is to use the 'Native Resource Template', but the template is a binary file that isn't suitable for using with subwcrev. Is there a way of creating a windows resource as part of a C# project that starts with a human-editable text file, similarly to the .rc files that C++ projects use? If so, how?

A: 

In VisualStudio 2005 or 2008 (at least), you can add a new "Resources File" item to the project (located under "General" in the "Add new item" dialog). This is a simple XML file, which is perfectly human-editable - all within VisualStudio. I don't know how SubWCRev works, but if it manipulates text files, this should do it.

Phil Reif
There's no option to add version resources to that, though. I don't think it compiles to a *windows* resource, but rather to some sort of dotnet resource.
Simon
+1  A: 

It seems that you don't have VS2005 or VS2008 and are looking to create windows resources. Yes, the ".resources" files are binary, but you can create a XML file or a text file which gets converted to this binary file. Take a look at the documentation of the ResGen tool. It is available with .NET.

Rohit
I have VS2008. I can create windows resources from a text file in a C++ project, but in a C# project they're either not windows resources, or not generated from a text file.
Simon
BTW, I don't mean CLR ".resources" files, I mean windows ".res" files.
Simon