Visual Studio 2011 Developer preview introduced a nice features that enables you to find the out the duplicate codes across the projects and solutions. This helps you to identify the duplicate code and logics which can be refactored and can be rewritten in a common method. Let’s have a look how to use it.
First select line of codes which you can think used in multiple places. Right Click and Select “Find Matching Clones in solutions”
This will search all the codes with in the solution semantically and display result in Code Clone Search Result window.
Code clone window will display the from – to line number along with the files name. You can click on that line to navigate to the code block or just mouse hover to see the cloned code.
Yes, this is really nice and interesting .
Cheers !
Aj