I recently stumbled upon Code Contracts and have started using them in my C# projects. However, I also have a number of projects written in C++/CLI.
For C# and VB, Code Contracts offer a handy configuration panel in the project properties dialog. For a C++/CLI project, there is no such panel.
From the documentation, I got the impression that adding Code Contracts support to a C++/CLI project should be a simple matter of calling some external tools as part of the build process (namely ccrefgen.exe
, cccheck.exe
, and ccrewrite.exe
). However, the number of command line options and restrictions concerning the call sequence have me somewhat intimidated.
Can anybody point me to a simple way to run the Code Contracts tools as an automated part of the build process in Visual Studio?
I arrived at this stackoverflow page because I am searching for the same answers that the original poster is looking for. So far, my searches seem to indicate that "Code Contracts" per se are not available for C++ native code. However, there is something similar called "VC++ (Visual C++) source annotations".
Try the following links:
http://dotnetslackers.com/articles/net/code-contracts.aspx#visual-c-source-annotations
http://social.msdn.microsoft.com/Forums/en/vstscode/thread/db48da4d-fc93-4e99-99cc-22d47c5838e9
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With