VS 2022 - myProcess_Exited never fires

graham knight 1 Reputation point

I have migrated from an old PC to a new one and from VS 2019 Community to VS 2022 Community. The desktop application I have written allows the user to double-click on a treeview node, this then runs the video file that node points to with the default video viewer. This all works fine.

Except when the spawned video player is closed, myProcess_Exited was executed when I ran it under VS 2019 but the routine is not run under VS 2022. I don't know if I have inadvertently deleted something, of if it's the switch between the two compilers.

This spawns the default video player:

    Private Sub TreeView1_NodeMouseDoubleClick(sender As Object, e As TreeNodeMouseClickEventArgs) Handles TreeView1.NodeMouseDoubleClick

        ' to start the video file we need the full path in the file system.

        ' Play the video with the default app for this filetype.

        myProcess.StartInfo.FileName = TreeView1.SelectedNode.FullPath

        MyProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized

        myProcess.EnableRaisingEvents = True

        ' Play the video and wait for the user to stop it.


    End Sub

but this is never executed (code extract):

    Private Sub myProcess_Exited(sender As Object, e As EventArgs) Handles myProcess.Exited

        Dim answer As Integer

        Dim sXMLWatchedEpisodes As String

        Dim sCurrentWatchedEpisodes As String

        Dim sXMLEpisodes As String

        ' Save the full path to this treeview node.

        Dim work1 = TreeView1.SelectedNode.FullPath

        ' Go and get the series title, series number and episode number from the full treeview node.


I don't know if I have enough disk space to have both compilers installed at once.

I would really appreciate any help.

An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,637 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 82,501 Reputation points

    Same question as my_process_Exited is never fired
    (I explained one of the reasons, with UWP apps)

    0 comments No comments