Reputation: 1
Everytime I execute my program, the main form closes by itself after about 15 seconds. The code is not the problem because it does the same thing when I put the whole code in comments. It's also not a key problem because it closes by itself even when I don't touch a single key when it's running. How can I fix it?
Upvotes: 0
Views: 628
Reputation: 21
Do you use Avast antivirus? I was getting exactly the same problems with VS2010 (although I my project is a c++ application rather than VS). I notice the date of your post is around the 10 March which is when it started happening to mine.
I've just worked out that Avast was auto-sandboxing my exe file and terminating it after 15 seconds, that might be what was happening to yours too.
I just added the .exe to the list of exceptions in Avast and it completely fixed the problem.
Upvotes: 2