“在失去范围之前释放对象”的 NDepend 规则
我正在评估 NDepend 作为强制代码质量和正确框架使用的一部分,并且我正在寻找一种方法来编写相当于 CA2000:在失去范围之前释放对象。其他人尝试过这样做,或者了解如何做到这一点?
I'm evaluating NDepend as a part of an effort to enforce code quality and correct framework usage, and I am looking for a way to write the equivalent of CA2000: Dispose objects before losing scope. Anyone else has tried to do this, or has knowledge about how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此规则无法通过 NDepend 实现,因为上下文位于方法体内。 NDepend 更多的是关于编写有关程序结构的代码规则,例如:
This rule is not implementable through NDepend because the context is inside method body. NDepend is more about writing code rules concerning the program structure like for example: