Tool for removing .NET Code Contracts from source code. Currently only C# is supported. I will gladly accept PR with VB support.
.NET 4.7.1 is required to run this application.
Install-Package CodeContractsRemover Tool is located at "PROJECT_DIR/packages/CodeContractsRemover.VERSION/tools/".
CodeContractsRemover.exe <Convert|Remove> <directoryPath> [--searchPattern *.cs *.csproj] [--encoding utf-8] [--ignorePattern .svn/ ]Example
CodeContractsRemover.exe Convert ./myprojectTo run using mono on Mac OS X
/Library/Frameworks/Mono.framework/Commands/mono code_contracts_remover.exe Convert ./myprojectTo run using mono on Linux
/usr/bin/mono code_contracts_remover.exe Convert ./myproject- Converts all Contract.Requires to "if(!x) throw new ArgumentException()" pattern.
- Converts all Contract.Assert to Debug.Assert
- Removes any other Contract invocations.
- Invariant methods are preserved
- Attributes and Contract classes are removed
- Removes any Contract invocations.
- Invariant methods are preserved
- Attributes and Contract classes are removed