Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
Refactor/Move String to App.Config Key

Both Visual Studio 2013 and ReSharper offer many convenient shortcuts for refactoring code. One I commonly use is ReSharper's "Move String To Resource File", which moves a hard-coded string a *.resx file in your project.

Unfortunately, ReSharper doesn't provide "App.config" as an option among the list of resource files to move to.

Does anyone know how to enable or create a "Move/Convert String to App.Config Key" refactoring using either VS or ReSharper?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Config management is always going to be specific to the program, and in many cases the build system. Not all programs read strait from the app/web config. In fact sometimes you want to create a class or interface that provides your configuration options. As such,I don't think ReSharper is going to provide an easy way to do what your asking.

You can create a macro to move your text to be consistent with the config approach you have taken.However, its going to be a developers role to update the config value, and update the build variables(i.e if you have a config value for a connection string, that needs to be updated by the build system if moving between different builds).

If you do take the macro approach, you can put in a default value in your macro, so that the config overrides the default value, but you dont have to update the config.

i.e

ConfigurationManager.AppSettings["Config_value"]?? "Default_Value";
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!