When I do throw exception I have added the exit, but after that the exe file is removed. 开发者_JAVA百科is it a known problem? (in VS2010)
Neither Application.Exit
nor Environment.Exit
will remove the executable from disk.
It sounds like some other process is trying to delete the executable. As soon as the application exits, the file will no longer be in use, and the .exe could be removed.
Depending on what you're doing, this could, potentially, be from a virus scanner. I would check your Virus Scanner logs to see if there is an issue there. This should be very unlikely if this is a completely managed (C# only) application - but if you're using native code that is "questionable" according to the scanner, it may be removing the executable.
Otherwise, I would check for other processes that may be trying to remove the executable.
No this doesnt sound right. Do you mean the .Exe Application file is been removed from Disk? That cannot/Should not happen on Exiting. Can you send mroe details on what you are trying to do, What kind of application, etc. I tried with a simple C# Console application and it wouldnt seem to happen in VS 2010.
精彩评论