Ask the Expert

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: