Is there a way to have the IDE automatically compile a text file into a resource file (.resource) an

Is there a way to have the Visual Studio .NET IDE automatically compile a text file into a resource file (.resource) and then have it embedded in a project's output assembly? I know the IDE has support for ResX files, but I'd like to use plain text files instead.

As it stands right now, I just create reference to a .resource file and, when I need to update that file, drop to the command-line and run resgen on the source text-file. I just wish there was an easier way.

Would this require the creation of a VS.NET add-in?
Actually, it's quite easy to do what you want. After you add the text file to the project, do the following in the properties for that project.

  1. Set the Build Action to Embedded Resource.
  2. In the Custom Tool field, type in RESGEN.

This was first published in March 2003

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: