Inline debugging in ASP.NET VB
i have an VB.NET application with few functions i need to debug (like ie. Assert in C#). Is it possible and how i do that ?
Public Shared Function cre开发者_如何学运维ateNumberArrayList(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.
Thanks
Assert is not specific to C#, it's a framework method, so it can be used in any .NET language. 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.
精彩评论