c# - Refactor/Move String to App.Config Key -


both visual studio 2013 , resharper offer many convenient shortcuts refactoring code. 1 commonly use resharper's "move string resource file", moves hard-coded string *.resx file in project.

unfortunately, resharper doesn't provide "app.config" option among list of resource files move to.

does know how enable or create "move/convert string app.config key" refactoring using either vs or resharper?

config management going specific program, , in many cases build system. not programs read strait app/web config. in fact want create class or interface provides configuration options. such,i don't think resharper going provide easy way asking.

you can create macro move text consistent config approach have taken.however, going developers role update config value, , update build variables(i.e if have config value connection string, needs updated build system if moving between different builds).

if take macro approach, can put in default value in macro, config overrides default value, dont have update config.

i.e

configurationmanager.appsettings["config_value"]?? "default_value"; 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -