Original: "C #" Let ReSharper Gray show the key of unused non-private members
Environment: Vs2010+resharper8
First say the answer:
1, set non-private accessibility to warning in inspection severity.
This page is in the ReSharper menu →options. Tip: The options are searchable, and the search box is above the options area
2. Enable Solution Wide Analysis (SWA). There are several ways to enable it:
-double-click the dot in the bottom right corner of the VS, or right-click the dot →analyze Errors in solution.
-Menu Resharper→options→code Inspection→settings→analyze errors in whole solution, hook it up.
Enabling this feature will prompt, saying it will reduce vs performance, occupy more memory what, OK. But if the project is not small or the machine is too bad, do be cautious. I understand that when enabled, RS will check member usage throughout the solution, and you think, a solution so much project, so many class member, every one to check, really is not a light weight simple life. Also mention a wake up, this function is in the current solution scope check, for some very common class members, it is not used in this scheme, but may be used in other scenarios, so do not see the gray members on the tick ~ anyway, we all understand, is my long-winded.
The following starts to squeak:
The problem was discovered because, as always known, for a private member without any use, ReSharper would show it as Gray, which would be good for my mildly code-neat patients, but non-private members would not be grayed out and found in the options non-private accessibility, but set as warning also useless, on-line search half a day also can't search said this problem, engage I thought is Rs bug, special letter Rs Feedback, people support siege lion very good, soon gave me reply, see name or a female. But at first she did not say the point, said let me re-build a project/solution what to see, and then let me put RS configuration guide her ... Anyway to go back and forth to communicate a number of email, can be bitter my poor Chinese, in this thank my Friend-ms MVP Alexis (this brother active in the MS Support community), as well as thank PowerWord ~ No thanks to the country, he/they gave me a great help in translation, Otherwise it would be hard for me to finish this call.
Later even succeeded to seduce each other to give me Remote Assistance ~ about the selection of remote Tools There is a question, I said I used a call QQ IM, this tool has a simple Remote Assistance function, see you convenient not ... and attached to her QQ international version of the official website to her ~ and inadvertently also help TX promotion, then she said to not teamviewer it, it seems that QQ in their there is still not to be seen. Later about the time, I open a good TV, tell her ID and pwd, she remote, I demonstrated the next "problem" to her, and then she took the RS configuration guide again, said to take back research and research, there is a message to inform me, on the flash people.
After the days to write her back, this time to focus on, said the next swa meaning, let me enable to see, sure enough problem solved, and then I Yinyuan her, then did not then. I guess she also consulted other people, only to poke in the crux of the problem.
Anyway, finally can clearly clear out the useless private and non-private members, thanks again to RS, thank Alexis, thank PowerWord.
-Wenbi-
"C #" lets ReSharper gray show the key to unused non-private members