How to share code contract settings across multiple projects?

Proposed How to share code contract settings across multiple projects?

  • Friday, July 13, 2012 7:10 AM
     
     

    Hello,

    I'm trying to put all the code contract settings in one location so they can be shared across multiple projects.  Unfortunately when I try and do so, it CCRewrite doesn't kick in. 

    Have you tried this and if so what is the magic formula?

    Thanks much,

    -Ian

All Replies

  • Monday, April 15, 2013 6:29 PM
    Owner
     
     Proposed

    You can put the settings into a contracts.props file (or whatever you want to call it) and then import that file in all your projects.

    You probably want to then delete the <CodeContractXXX>...</CodeContractXXX> settings in the project files.

    Note that if you do this, you cannot change the settings from your project properties any longer. If you do, it will write them back into the project file and not into the shared imported file. That's just how properties work in VS project files.


    Cheers, -MaF (Manuel Fahndrich)