I wonder how to correctly use Code Contracts in .NET Core , so far I have tried to add CC to my project, compile and debug it. I am confused by the message that appears in every call that uses Contract.Requires and the information found when searching on Google. The message says: “The assembly must be overwritten using the binary rewriting code (CCRewrite) code because it calls up the contract. The“ Competition ”and“ CONTRACTS_FULL ”characters are defined. Remove all explicit CONTRACTS_FULL character definitions from your project and rebuild. CCRewrite ... . "
As I see, there are no CC parameters in the project properties, and as I can see, the CC github repository is almost dead. Is there any way how to successfully use CC in .NET Core?
And if not, is there an easy way to replace them? I use Contract.Requires and ContractClassAttribute. Replacing a contract. The requirements are obvious, but ContractClassAttribute blows my mind :-)
Thanks.
c # .net-core code-contracts
Jiří Zajíček
source share