You need to write Key
before property. like
New With {Key element.Id, Key element.Name}
in VB.
So,
Result = TestList.DistinctBy(Function(element) New With {Key element.Id, Key element.Name})
See the documentation for anonymous types in VB for more details.