After some research, I found out that Microsoft doesn't support System.Runtime.Remoting.Messaging from .net core onwards.
I have the following code that makes use of the library:
Delegate Sub LogExceptionDelegate(ByVal e As Exception)
Public Sub HandleException(ByVal e As Exception)
Dim logDelegate As New LogExceptionDelegate(AddressOf LogException)
logDelegate.BeginInvoke(e, New AsyncCallback(AddressOf LogCallBack), Nothing)
End Sub
Private Sub LogCallBack(ByVal result As IAsyncResult)
Dim asyncResult As AsyncResult = CType(result, AsyncResult)
Dim logDelegate As LogExceptionDelegate = CType(asyncResult.AsyncDelegate, LogExceptionDelegate)
If Not asyncResult.EndInvokeCalled Then
logDelegate.EndInvoke(result)
End If
End Sub
Would the following be a good replacement in .net6?
Delegate Sub LogExceptionDelegate(ByVal e As Exception)
Public Sub HandleException(ByVal e As Exception)
Dim logDelegate As New LogExceptionDelegate(AddressOf LogException)
Task.Run(Sub() logDelegate.Invoke(e))
End Sub
Any help is appreciated.