Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
want to compare 2 C# class files from 2 versions of project, project base functionalities would be same but some of class can be changed (code changed) in any project. Now i want to to know the list of differences between like Added (how many new methods/properties/class are added) and Modified (how many methods/properties/class are modified). Is there any best way to do this?

What I have tried:

Tried to compare the files using code compare but could not able to get the differences, trying to use Roslyn compiler but still not matching anything to my requirement.
Posted
Updated 11-Mar-19 10:25am
Comments
MadMyche 11-Mar-19 9:17am    
Were these in some type of versioning system?

You can use the ApiChange utility (originally written by Alois Kraus) for comparing e.g. dll's: GitHub - arlm/apichange: Fork of the codeplex API Change repository[^]
We use it on our builder to detect breaking changes to the API:
"ApiChange.exe" -diff -new "API.dll" -old "APIold.dll" >> APIchanges.txt
FIND "- public" APIchanges.txt
IF ERRORLEVEL 1 EXIT /B 0
ECHO  Errors: API or Interface is broken ! See APIchanges.txt >&2
Rem Use EXIT /B 0 for build to warn only.
Rem Use EXIT /B 1 for build to fail:
EXIT /B 1
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900