Finding Clone Codes in Visual Studio 2011 Developer Preview

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 !


Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.