Hello,
I am writing a C# Windows Forms application that displays lots of icons in a datagridview. It works correctly when debugging is used. However when start without debugging is used, it displays an error message (named: .NET-BroadcastEventWindow.2.0...) for each icon that is "corrupt" or "not compatible" which is very disturbing. It works fine later on.
Can someone tell how to solve it, either how to detect corrupt or not compatible images or just ignore the error messages :)?
Thanks
Edit:
The error message shows the path of images that are corrupt. Windows Photo Gallery or Picasa cannot open them either. Somehow they are really corrupt. I need to detect them or ignore the errors (like debugger does) to get rid of error dialogs.
Edit2:
Actually I have found the answer. Some files contain more than 1 icons in it although they are .ico files (which is why photo gallery cannot open them). As far as I observed those are just 4 to 32-bit or small-middle-large sized variations of the same icon and for some reason my icon extraction does not work properly on them. What interesting is "new Icon(path)" is able to return one of the icons in it and it is enough good for this application.
What still confuses me is how and where that corrupt image exception is thrown, why I was not able to catch it? How does debugger catch and ignore it?