views:

32

answers:

2

There are a bunch of hardcoded strings in a ASP.NET application.

eg. string constSetting = "XYZ";

There are a LOT of them. Is there a tool/plugin for Visual Studio 2008 to refactor it in such a way that the constant string goes into web.config and the above line gets replaced by the retrieved string from web.config app settings?

A: 

This, again, isn't really an answer to your question as such, but resharper do have a method for pulling strings out to resource files:

http://www.jetbrains.com/resharper/features/code_refactoring.html#Move_String_to_Resource

Paddy
+1  A: 

I would recommend using a resource file instead of the web.config. And for this, Resharper is an amazing tool to do this:

Resharper 5.1 from Jetbrains

Here are some detailed informations:

Move Strings to Resource Files

Flynn