如何跨多个项目共享代码合同设置? [英] How to share code contract settings across multiple projects?

查看:95
本文介绍了如何跨多个项目共享代码合同设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在尝试将所有代码合同设置放在一个位置,以便可以在多个项目中共享它们。 不幸的是,当我尝试这样做时,CCRewrite没有启动。 

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?

非常感谢,

-Ian

推荐答案

您可以将设置放入contracts.props文件(或任何您想要调用的文件)和然后在所有项目中导入该文件。

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.

您可能希望删除< CodeContractXXX> ...< / CodeContractXXX>项目文件中的设置。

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

请注意,如果执行此操作,则无法再更改项目属性中的设置。如果这样做,它会将它们写回项目文件而不是共享导入文件。这就是属性在VS项目文件中的工作方式。

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.


这篇关于如何跨多个项目共享代码合同设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆