.net core 是否支持代码契约? [英] Are code contracts supported in .net core?

查看:27
本文介绍了.net core 是否支持代码契约?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 .net 框架中有代码契约允许我在我的代码中指定前/后条件..net core/.net 5 是否支持它们?

In the .net framework there were Code Contracts which allowed me to specify pre/post conditons in my code. Are they supported in .net core/.net 5?

推荐答案

Namespace System.Diagnostics.Contracts 可用,但项目放弃.

Namespace System.Diagnostics.Contracts is available but project is abandoned.

替代 VS2019
https://softwarerecs.stackexchange.com/questions/47108/the-best-code-contracts-alternative-for-vs-2017-2019-and-net-core-projects

关于.Net Core的讨论

Discussion about .Net Core

https://github.com/dotnet/runtime/issues/23869

代码契约是否仍然是 2020 年的推荐方式

Is Code Contracts still the recommended way to go in 2020

https://github.com/dotnet/docs/issues/17640

这篇关于.net core 是否支持代码契约?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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