Mono(ccrewrite)
π ccrewΜΆiΜΆtΜΆeΜΆ ccrewrite β the manual page, bestie edition π
okay so this is ccrewrite, from the Mono manual (section ccrewrite, iykyk) and she is literally the girl who rewrites your CLR assemblies so your code contracts actually get checked at runtime. no cap. π
β¨ NAME β¨
ccrewrite β rewrite CLR assemblies for runtime code contract verification. periodt.
β¨ SYNOPSIS β¨
ccrewrite --assembly=<assembly> [options]
π¦ DESCRIPTION π¦
So basically? ccrewrite rewrites CLR assemblies and converts calls into the System.Diagnostics.Contracts namespace so they do runtime contract verification for real. and yes, that includes contract inheritance for virtual methods. she's giving thorough. π
β οΈ the assembly must have been built with the symbol CONTRACTS_FULL defined, otherwise the compiler already yeeted all your calls to the contract methods. gone. deleted. not coming back. π
rn only pre-conditions are supported, using the Contract.Requires() method. contract inheritance for virtual methods is supported though, slay. also heads up: only a limited range of operations and types can be used inside a pre-condition, and if ccrewrite can't process the assembly you gave her, she will show you an error message. she's not being mean, she's being honest. π
πΈ CONFIGURATION OPTIONS πΈ
--assembly <assembly-name>β the assembly to rewrite. if you don't pass--output, this file gets overwritten with the rewritten version. lowkey destructive, highkey intentional. π«Ά--debugβ use debug information if it's available, so your contract failure messages are actually useful instead of cryptic. main character debugging energy. π₯--helpβ show help forccrewrite, listing all the configuration options. bestie behavior fr fr.--level <level>(default=4) β sets which contract types are present in the rewritten assembly:0= No contracts1= Release requires2= Requires3= Ensures4= Invariants
and note: each level includes all previous levels. it's cumulative, she's generous like that. π
--output <file-name>β write the rewritten assembly to the specified file. if this isn't present, then the input assembly file is overwritten with the rewritten version. again. be careful. π--rewrite(default=true) β rewrite the assembly. iffalse, then literally nothing is done. she's off the clock. π--throwOnFailure(default=false) β throw aContractExceptionon unhandled contract failure. the default behaviour is toAssert. pick your fighter. β
π§ AUTHOR π§
Written by Chris Bacon. icon.
π COPYRIGHT π
Copyright (C) 2010 Chris Bacon. Released under MIT license. we love a permissive license moment. π
π WEB SITE π
Visit http://www.mono-project.com for details. go, go, go. π¦
okay that's the whole thing bestie, no notes, ate and left no crumbs π and as for the boring official bits: this page lives in the Mono(ccrewrite) manual, that's the source/version tag it signs off with, and that's the footer name right there at the bottom too β so consider it mentioned, cute sign-off complete, mwah π β¨
π¦ where this page comes from
- alpine 3.24: mono-doc 6.14.1-r1 Β· MIT
- arch rolling: mono 6.12.0.206-1 Β· GPL AND LGPL2.1 AND MPL
- epel 10: mono-core 6.14.1-1.el10_2 Β· MIT
- epel 9: mono-core 6.12.0-5.el9 Β· MIT
- fedora 43: mono-core 6.12.0-21.fc43 Β· MIT
- fedora 43: mono-core 6.12.0-21.fc43 Β· MIT
- fedora 44: mono-core 6.14.1-3.fc44 Β· MIT
- fedora 44: mono-core 6.14.1-3.fc44 Β· MIT
- fedora 44: mono-core 6.14.1-4.fc44 Β· MIT
- fedora 44: mono-core 6.14.1-4.fc44 Β· MIT
- nixos 26.05: mono 6.14.1
- nixpkgs unstable: mono 6.14.1
- opensuse-leap 16.0: mono-devel 6.12.0-bp160.1.1 Β· LGPL-2.1-only
- opensuse-leap 16.0: mono-devel 6.12.0-bp160.1.1 Β· LGPL-2.1-only
- opensuse-leap 16.0: mono-devel 6.12.0-bp160.1.1 Β· LGPL-2.1-only
- opensuse-leap 16.0: mono-devel 6.12.0-bp160.1.1 Β· LGPL-2.1-only
- Copyright (C) 2010 Chris Bacon
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms