Using Await in BackgroundWorker causes WorkerComplete event to be raised
问题 I have this weird problem. I need to invoke a process from within a background worker Private Shared _process As Process Private Shared _StartInfo As ProcessStartInfo Private WithEvents _bwConvertMedia As New BackgroundWorker Here is the work in DoWorkAsync Private Async Sub _bwConvertMedia_DoWorkAsync(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles _bwConvertMedia.DoWork For AI = 1 To 100 _StartInfo = New ProcessStartInfo(".\mycmd.exe", "-1") _StartInfo