I am not very experienced with VB.NET but I have to build an application using it in order to communicate with some software. Basically, I need to be able to call this exe and have it run to perform some tasks, then close itself down.
I have the tasks running on page load but since I don’t want the application to actually open, I use a Me.Close() to close it once it’s finished the tasks. So, the whole thing works great (the tasks are even performed) except the Me.Close() causes a message to come up saying the application “has stopped working.”
Any ideas why this is happening? Is it because I’m trying to close it while it’s loading itself?
Any suggestions on how to achieve this in a different way?
I am forced to perform these tasks in VB, so please don’t just say I should not be using VB.NET for this. I know I shouldn’t be but I have to.
Ok, thanks a lot in advance.
I am not very experienced with VB.NET but I have to build an application
Share
If you don’t want the application to open, then don’t use a WinForms application (which I am assuming you are using). Instead, create a Console project, and place your code in the Main subroutine. The program will then run on the command line and close immediately when finished.