I have a VB.net application and I have a function with this signature:
Public Function DeSerializeAnObject(XmlOfAnObject As String, ObjectType As Type) As [Object]
but following call is giving error (at DebugPackage):
Dim obj As ObjectSerializer = New ObjectSerializer
obj.DeSerializeAnObject("", TypeOf(DebugPackage))
DebugPackage is a type and can not be used as exception.
You’re not using the right keyword, you should use GetType instead of TypeOf:
Differences between
GetTypeandTypeOffunctions: