在ASP.NET中是否值得使用Debug.Assert? [英] Is it worth using Debug.Assert in ASP.NET?

查看:138
本文介绍了在ASP.NET中是否值得使用Debug.Assert?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ASP.NET中设置正确的调试环境似乎是一个相当大的麻烦,我只是想知道如果使用Asserts是要走的路。我已经读了一下,看到你需要修改你的web.config来正确使用Asserts。这通常是最好的方法,还是有其他可能更容易使用的调试方法?

It seems like a fairly large hassle to set up a proper debug environment in ASP.NET and I'm just wondering if using Asserts are the way to go or not. I've read a bit and saw that you need to modify your web.config to properly use Asserts. Is this usually the best way to go or are there other methods of debugging that might be easier to use?

我们不使用单元测试框架,真的与这个问题有关。

We don't use a unit testing framework so that isn't really relevant to the question.

你如何知道他们工作正常或不工作的区别?目前我可以在我的代码中放置断言,它绝对没有,因为它们没有在web.config中配置。这对我来说似乎很危险。

How do you know the difference between them working properly or not working at all? Currently I can put in asserts in my code and it will do absolutely nothing because they are not configured in the web.config. This seems dangerous to me.

推荐答案

我会指导你:何时应该使用Debug.Assert()?。有几个很好的答案可以告诉你什么时候使用它们,如果在你的应用程序中值得,你可以从中找出它。

I would direct you here: When should I use Debug.Assert()?. There are several good answers that can tell you when it's good to use them, and you can figure out from there if it's worth it in your app.

这篇关于在ASP.NET中是否值得使用Debug.Assert?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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