Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

167
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda