[英]Inline debugging in ASP.NET VB
i have an VB.NET application with few functions i need to debug (like ie. Assert in C#). 我有一个VB.NET应用程序,该应用程序仅具有一些我需要调试的功能(例如,在C#中断言)。 Is it possible and how i do that ? 有可能吗,我该怎么做?
Public Shared Function createNumberArrayList(ByVal startValue As Integer, _
ByVal endValue As Integer, _
Optional ByVal isBackwards As Boolean = False) As ArrayList
Dim nArrayList As New ArrayList()
If Not isBackwards Then
For index As Integer = startValue To endValue
nArrayList.Add(index)
Next
Else
For index As Integer = endValue To startValue
nArrayList.Add(index)
Next
End If
Return nArrayList
End Function
Basically what i need is to enter few values and see if the function works and returns proper ArrayList. 基本上,我需要输入几个值,然后查看该函数是否工作并返回正确的ArrayList。
Thanks 谢谢
Assert is not specific to C#, it's a framework method, so it can be used in any .NET language. 声明不是特定于C#的,它是一种框架方法,因此可以在任何.NET语言中使用。 You can do something like this: 您可以执行以下操作:
Diagnostics.Debug.Assert(nArrayList.Count > 0)
Edit: 编辑:
I'm not sure whether Debug.Assert works in ASP.NET applications or not, I found contradictory info on the web about this... If it doesn't work, check out this CodeProject article . 我不确定Debug.Assert是否可在ASP.NET应用程序中运行,我在网上发现了与此有关的矛盾信息。如果它不起作用, 请查看此CodeProject文章 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.