[#RESHARPER] HowTo: Find hardcoded strings (to cut off fingers on a Monday)


When some time ago I wrote a post where he showed how to configure the IDE of Visual Studio 2012 so it hurts us to use strings “harcodeados”, the friend Julio Trujillo (@JulioTrujillo) copied me a trick that was given in support of ReSharper for working with strings in a project.

The steps are as follows

1. Inside of Visual Studio, access the project properties

2 Change the following properties so that our project support localization

Reachable = Yes

Locatable Inspector = Pessimistic


3 Starting from this time, ReSharper will show all the strings emphasizing them in blue.


4. The interesting part comes now. If we select a string and deploy options from ReSharper menu (ATL + ENTER) can select the option “Options for Element is locatable inspection / / Find all issues of this type in scope”


5 We define the scope of search, in this case the entire project


6. The panel with the search result shows all the strings “badly treated” in our project.


7. At this point we can export the list of results in mode text, xml, or html.


8. In the case of export to text, the result would be similar to the following:

Solution sdkAugmentedRealityCS.sln
Project sdkAugmentedRealityCS
sdkAugmentedRealityCS\Class1. cs:18 Localizable string: “Start list names”
sdkAugmentedRealityCS\Class1. cs:19 Localizable string: “child”
sdkAugmentedRealityCS\Class1. cs:20 Localizable string: “girl”
sdkAugmentedRealityCS\Class1. cs:21 Localizable string: “End names list”

Saludos @ Home

El Bruno

image image image

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s