There appears to be a problem with the VS IDE/debugger when watching new BusinessListBase objects. Simply creating a new BLB, the debugger will internally report the following value for NewProjectResources and GetProjectResources: "Count = Exception of type: '{System.TypeLoadException}' occurred. "
This was previously identified in the following thread http://forums.lhotka.net/forums/thread/4748.aspx. Since the thread title refered to ActiveObjects, I'm not sure if Rocky noticed the issue at that time. I have confirmed it is an issue with PTracker 2.0.3 and 2.1 at this point.
To reproduce the issue, put a break point on the ProjectResources.NewProjectResources and watch what the debugger windows report. Note: If you call the .Count method on the collection, it returns the correct value and the WinTracker appears to work fine and ignores the "exception". Additionally, turning on all thrown exceptions, including TypeLoadException doesn't catch it, so I suspect the issue is something internal to the .Net framework which it is swallowing and the VS IDE is not reporting on.
I would be interested in others checking and confirming the behavior.
Jim Wooley
http://devauthority.com/blogs/jwooley
Public Class GenericClass(Of T)
Protected Sub New()
End Sub
Private _T As T
Public Property Bar() As T
Get
Return _T
End Get
Set(ByVal value As T)
_T = value
End Set
End Property
End Class
Public Class Class1
Inherits GenericClass(Of String)
Private _Ball As String = "Foo"
Private Sub New()
MyBase.New()
End Sub
Public Shared Function GetClass() As Class1
Return New Class1
End Function
Public Property Ball() As String
Get
Return _Ball
End Get
Set(ByVal value As String)
_Ball = value
End Set
End Property
End Class
Public Class ClassList
Inherits System.ComponentModel.BindingList(Of Class1)
Private Sub New()
End Sub
Protected Overrides Function AddNewCore() As Object
Dim child As Class1 = Class1.GetClass
Me.Add(child)
Return child
End Function
Public Shared Function GetList() As ClassList
Return New ClassList
End Function
End Class
(Bumping) - While this isn't a critical issue because it just seems to be with QuickWatch and Watch ...the code actually works.
But I won't say it is a non-issue because I have become quite accustomed to my QuickWatch during development and debugging :-)
Copyright (c) Marimer LLC