We are developing windows application in VS2005 (VB.Net). I have placed resource clearing and audit entry in the "MyApplication_Shutdown" event. But this event is not getting fired when our application exits.
When I tired with the sample application, in our system it works fine. I don't know whether I have disabled any setting so that this event does get fired.
Note: I have checked application framework checkbox in application settings.

VS2005 MyApplication_Shutdown not getting fired.
Mahesh Gaware
I followed the sample and had no problems hitting Shutdown.
Is your event handler really in the partial MyApplication class of your vb project Does the function declaration end on Handler Me.Shutdown
--
SvenC
Walter30140
Misiacik7
I could get the problem.
We have a login screen as startup. If the login is valid we do the following
frmLogin.hide()
frmMain.show()
Since we hide the screen, the shutdown event is not getting fired when we close the frmMain.
Alternatively.
frmLogin.close()
frmMain.show()
In this case the shutdown events gets fired, but my frmMain also getting closed. How to handle this.
Nandagopal.
GreenStone90
Nandagopal
zenzai
Hi,
did you follow this sample: http://msdn2.microsoft.com/en-us/library/036kk0as(VS.80).aspx
--
SvenC
Samoyed
Just combine the calls:
frmLogin.Hide()
frmMain.Show()
frmLogin.Close()
--
SvenC
Shaurya
Alternatives are to write an Application.ApplicationExit event or to not use not use the application framework and go back to plain-jane Main.
Anth0ny
I followed as given in the url sent by you.
I even checked whether our application gets to abnormal exit.
Nandagopal.P.K.S