Search code examples
visual-studioembedded-resource

How to avoid the underscore prefix from the auto-generated property names for imported resource files in VS2008?


For some reason VS2008 adds a '_' prefix to the property names of the resources in the auto-generated Resource class.

I get this when I add multiple image files to the project using the "Add existing file" dialog.

How can I avoid this?

Google failed me, or, I might have failed google, either way, please help me! :)


Solution

  • The reason VS was adding an underscore prefix was that the file names of the resources I imported had purely numerical name part without the extension (ie. "1.bmp") and it's illegal to have a class or property name that begins with a number, thus it appends an underscore.