Directory Freebies VS CheatSheet Forum

RSS

Email

Translate

Home About Archive Privacy Contact Advertise Guest Post
Posted by Shahar Y on Apr 11th, 2008 | Filed under .Net, C#, Utilities, Visual Studio |

Recently, I ran into a great free Microsoft tool which is called - Resource Refactoring Tool. This tool provides developers an easy way to extract hard coded strings from the code to resource files.

Resource files (.resx files) consists of XML entries, which specify objects and string inside XML tags. Those files can be opened with text editors and are completely readable and maintainable. One of its common usage is for localization.

Tool features:

  1. Works with C#, VB.Net languages.
  2. Supports all project types including web sites and web application projects.
  3. Finds other instances of the text being replaced in the project automatically.
  4. Lists existing resources by their similarity level to the text being replaced.
  5. Automatically replaces hard coded string with a reference to resource entry.
  6. A preview window to show changes.

How does it work?

Right click on a hard coded string, choose Refactor and then Extract To Resource.

Extract To Resource

The next screen pops up where we can:

  • Choose whether to extract just the current hard coded string / All instances in the current source file / All instances in the project.
  • Choose whether to use an existing resource file or to create a new one.
  • Create a new entry in the resource file.
  • Getting a preview dialog to see the changes before they actually happen.

image 

After closing this dialog, the string will automatically be replaced with the reference to the resource that have been chosen.

This tool works on Visual Studio 2005 and 2008, but when both Visual Studio 2008 and 2005 are installed, the Resource Refactoring Tool is not installed on Visual Studio 2008.

Download it here, enjoy…

Tags: , , , , , , , , , ,

2 Responses to “Free Tool - Extract Hard Coded Strings to Resource Files”


  1. Regev Porat Said on Apr 13, 2008 :

    Very nice - thanks!!

1 Trackback(s)

  1. May 20, 2008: PHARMANCY information. » PHARMANCY.ORG

Post a Comment

Advertise on Dev102 Bitrix Site Manager

Read reviews and compare prices on : Laptops , Software Like Windows, Office Suites & Many More.

Advertise on Dev102
Write Article for Dev102

Write for us!

We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution

Learn More