Compare .Net assemblies for changes according to semantic versioning rules.
This project is still in an alpha state because it's very new and doesn't handle enough cases. Currently only public types and members are compared and there is very little handling for generics. These two things are the main points on the roadmap as well as handling some edge cases.
A list of currently supported changes can be found here: List of detectable changes
The public API is pretty simple and basically is just the
It provides several
Compare methods taking two assemblies or two lists of
All of them return a list of changes as
A change has an ID, a severity (Major, Minor, Patch) and a message explaining the change.
TypeComparerSettings you can influence how the comparison works. The following options are available:
|IgnoreCase||When true, comparison of type and member names is case insensitive||False|
|AssemblyCaseSensitive||When true, comparison of assembly names is case sensitive||False|
Additionally, there is the static method
GetNewVersion which takes the changes and either an assembly or a version number.
It checks the changes and returns an updated version number depending on the highest change severity.
Depending on the used .Net Standard version, some checks are different or not available:
|1.5||- References are checked if the
- Checking a parameter default value works in a reflection-only context
With the CLI you can compare assemblies simply by providing two file paths. If you use the
--silent switch the result can be automatically parsed.
Important: Depending on the assembly framework target you also need to run the CLI with the same one. i.e. you need to run it with .Net Core for .Net Standard assemblies and with the full .Net framework for assemblies targeting the full framework.
breakdotnet-cli --old=<old-assembly> --new=<new-assembly> [options] breakdotnet-cli -h | --help breakdotnet-cli -v | --version
|-h --help||Shows the help|
|-v --version||Shows the library and CLI version|
|-s --silent||Only print output without any additional text|
|--c --changes||Show changes in the format "ID: EXPLANATION"|
|-r --recommendation||Show recommended new assembly version|
|--old||Path to the old assembly|
|--new||Path to the new assembly|
|--ignore-case||Ignore case when comparing type or member names|
|--assembly-case-sensitive||Comparison of assembly names is case sensitive|
|1||An unexpected Exception happened|
|2||An invalid argument was provided|
|3||No or only one assembly path was provided|
|4||One of the assembly files was not found|
|5||Platform not supported. Make sure to run the correct framework (.Net Core or full .Net)|
List changes and show the new recommended version:
breakdotnet-cli --old="Path\To\OldAssembly.dll" --new="Path\To\NewAssembly.dll" -c -r
List only changes and nothing else:
breakdotnet-cli --old="Path\To\OldAssembly.dll" --new="Path\To\NewAssembly.dll" -c -s
Only print out new recommended version:
breakdotnet-cli --old="Path\To\OldAssembly.dll" --new="Path\To\NewAssembly.dll" -r -s
List changes and ignore case when comparing type or member names:
breakdotnet-cli --old="Path\To\OldAssembly.dll" --new="Path\To\NewAssembly.dll" -c --ignore-case