Visual Studio 2015 中代码合同的最佳替代方案是什么? [英] What is the best alternative for Code Contracts in Visual Studio 2015?

查看:50
本文介绍了Visual Studio 2015 中代码合同的最佳替代方案是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望以最优雅的方式验证我的代码中的方法参数.Code Contracts 在 2015 年似乎不起作用.有人使用任何替代方案吗?

I am looking to validate method parameters in my code, in the most elegant fashion possible. Code Contracts don't seem to work in 2015. Does anyone use any alternatives?

推荐答案

他们正在努力:https://github.com/Microsoft/CodeContracts/pull/36

如果您迫不及待,可以采取一些措施来解决此问题:https://github.com/Microsoft/CodeContracts/issues/18

If you cannot wait, there are a few things that you can do to fix this: https://github.com/Microsoft/CodeContracts/issues/18

这篇关于Visual Studio 2015 中代码合同的最佳替代方案是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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