0

In my application (WinForms) I use WebBrowser to display reports. The WebBrowser is a part of a from and is disposed every time user closes the report form.

Randomly, but regularly something crashes. When it crashes it stays crashed until I restart the application. After application restart everything is back to normal. It happens on Windows 10.

Symptoms:

1) Images (loaded from local file system) do not display. Sometimes they do not show up at all, sometimes a small "X" symbol show up instead of image: enter image description here. Images are not very large (0.5 MB max). HTML is fine (opened manually in a browser looks fine).

2) Crashed explorer in save file dialog

  • missing navigation tree on the left
  • black squares instead of some icons
  • some icons change (see the Computer icon)

enter image description here

After application restart it looks ok:

enter image description here

What could be the reason for the crash? How to prevent it?

Andrzej Gis
  • 13,706
  • 14
  • 86
  • 130
  • [Memory leaks](https://stackoverflow.com/q/5020814/1997232). [Search](https://stackoverflow.com/q/12474321/1997232) for them (I recommend dotMemory). – Sinatr Feb 16 '18 at 12:42
  • Could you show some sample code? Is WebBrowser a COM object? COM objects need to be handled with great care, and if not, often result in bizarre crashes like you are experiencing. – RikRak Feb 16 '18 at 13:00
  • @RikRak Unfortunately I connot extract a code sample. However It's a simple form with standard System.Windows.Forms.WebBrowser control. – Andrzej Gis Feb 16 '18 at 17:36
  • @gisek it's going to be difficult for anyone to help you without a code sample I think :-( – RikRak Feb 19 '18 at 13:24

0 Answers0