Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find all source hardcoded strings

I need to move all the hard coded strings in my source code in .resx files. Is there a tool that could help me find all the hardcoded strings within C# code?

like image 225
Cornel Avatar asked Mar 22 '10 09:03

Cornel


1 Answers

ReSharper 5 is obvious a choice, but many tips must be set so as to achieve your goals,

  1. Turn on solution wide analysis.
  2. Go to ReSharper|Options|Code Inspection|Inspection Severity|Potential Code Quality Issues|Element is localizable set to Show as error.
  3. Go back to Solution Explorer and click on the project (csproj).
  4. In Properties panel under ReSharper category, set Localizable to Yes, Localizable Inspector to Pessimistic.

Then you can find almost all you need in Errors in Solution panel.

Hope this helps.

like image 65
Lex Li Avatar answered Sep 28 '22 05:09

Lex Li