I used Code Contracts mechanism in my C# projects written via Visual Studio 2015 and I like it. I learned about this mechanism through the C# 6.0 in a nutshell book. But already in C# 7.0 in a nutshell book this info disappeared. This puts me on my guard...
I saw the question Does Visual Studio 2017 work with Code Contracts and its content doesn't inspire me with optimism... . But now I use Visual Studio 2019.
If I try to use Code Contracts in .Net Framework 4.8 and .Net Core 3.1 then I get the runtime-error (when I started my exe manually):
Process terminated. Precondition failed. An assembly (probably "ConsoleApp_CodeContractsCore") must be rewritten using the code contracts binary rewriter (CCRewrite) because it is calling Contract.Requires and the CONTRACTS_FULL symbol is defined. Remove any explicit definitions of the CONTRACTS_FULL symbol from your project and rebuild. CCRewrite can be downloaded from http://go.microsoft.com/fwlink/?LinkID=169180. \r\nAfter the rewriter is installed, it can be enabled in Visual Studio from the project's Properties page on the Code Contracts pane. Ensure that "Perform Runtime Contract Checking" is enabled, which will define CONTRACTS_FULL.
But I see Code Contracts for .NET hasn't version for Visual Studio 2019... Its source code has not been updated for several years.
Is Code Contracts mechanism already dead and hasn't future?