As provided, the VB code for TypeB will not compile based on the C# code for TypeA; Friend Dispose is a different access level from TypeA.Dispose (which is Protected, not Friend). Plus, TypeB.Dispose actually causes infinite recursion and eventually StackOverflowException. Following is correct code:
Friend Class TypeB
Inherits TypeA
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing Then
' dispose of managed resources
End If
' free native resources.
Finally
MyBase.Dispose(disposing)
End Try
End Sub 'Dispose
End Class 'TypeB