This part of code cause this error :
Error 1 Method 'Private Shared Sub CurrentDomain_UnhandledException(sender As Object, e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs)' does not have a signature compatible with delegate 'Delegate Sub UnhandledExceptionEventHandler(sender As Object, e As System.UnhandledExceptionEventArgs)'.
' Add the event handler for handling non-UI thread exceptions to the event.
AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf CurrentDomain_UnhandledException