I've encountered an extremely strange incident. I am implementing a very simple "cancel" function into a downloader, but I need to make sure that after the download of the file is cancelled, that the file that was being written to is deleted.
Here's the code:
private void button1_Click(object sender, EventArgs e)
Now it's clear that if the execution gets passed the while() loop, then the file has to be there. But just for debugging purposes, I'm checking if it's there anyway.
So I break on if the file exists...
I step into the if...
Now at this point, of course, C# thinks the file is there (well, because the file is there...)
Now I continue to step into the flow...
But something very strange happens here.... NOTHING! No message box is shown. I don't understand why this is... I've never seen something like this.
So out of curiosity, and bewilderment, I throw in another check to see if the file is locked, and display a messagebox if it is not locked. Shown below:
Now, the second messagebox shows but the first one does not. What's going on?!?!?!?!?!?!?
It's as if there's something fundamentally wrong with making the call to MessageBox(), but only for that one block of code. The rest of the application runs perfectly with Messageboxes.
Have any of you had any similar issues?