Eureka155
Eureka155

Reputation: 23

WebBrowser control crashes on Windows 10

The following short code example demonstrates WebBrowser crashing for some pages. The problem started after a fresh installation of Windows 10 and Visual Studio Community 2015 on 26-27 December 2015. The problem did not occur with the previous installation of Windows 10 and Visual Studio Community 2015. The same program has been tested on another computer with the same software and operating system and the same problem occurs.

Clicking 'Download 2' successfully downloads the page from Google.

Clicking 'Download 1' starts downloading from Bloomberg and after most of the page is visible a popup message opens with "WindowsFormsApplication1.exe has triggered a breakpoint." with execution stopped at line "Application.Run(new Form1())". Sometimes the error message does not show until the page is scrolled. The same URL downloads on IE11 without problems and Developer Tools / compatibility indicates no problems. Setting the Webbrowser emulation level in registry to 11001 makes no difference. WebBrowser1.ScriptErrorsSuppressed makes no difference.

If 'continue' is clicked another message opens with "Unhandled exception at 0x12C731C2 (Flash.ocx) in WindowsFormsApplication1.exe: 0xC0000602: A fail fast exception occurred. Exception handlers will not be invoked and the process will be terminated immediately."

If 'continue' is selected another message opens with "Exception thrown at 0x00000000 in WindowsFormsApplication1.exe: 0xC0000005: Access violation executing location 0x00000000. If there is a handler for this exception, the program may be safely continued."

Is there something that can solve the problem?

using System;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public class Form1 : Form
{

    TextBox textBox1;
    TextBox textBox2;
    Button button1;
    Button button2;
    TableLayoutPanel table1;
    WebBrowser webBrowser1;

    public Form1()
    {

        textBox1 = new TextBox();
        textBox1.Width = 200;
        textBox1.Text = "http://www.bloomberg.com/energy";

        button1 = new Button();
        button1.Text = "Download 1";
        button1.Click += button1_Click;

        textBox2 = new TextBox();
        textBox2.Width = 200;
        textBox2.Text = "http://www.google.com";

        button2 = new Button();
        button2.Text = "Download 2";
        button2.Click += button2_Click;

        webBrowser1 = new WebBrowser();
        webBrowser1.Dock = DockStyle.Fill;
        webBrowser1.ScriptErrorsSuppressed = true;

        table1 = new TableLayoutPanel();
        table1.Dock = DockStyle.Fill;
        table1.RowCount = 3;
        table1.ColumnCount = 2;
        table1.Controls.Add(textBox1, 0, 0);
        table1.Controls.Add(button1, 1, 0);
        table1.Controls.Add(textBox2, 0, 1);
        table1.Controls.Add(button2, 1, 1);
        table1.Controls.Add(webBrowser1, 0, 2);
        table1.SetColumnSpan(webBrowser1, 2);

        this.Controls.Add(table1);
        this.WindowState = FormWindowState.Maximized;

    }

    private void button1_Click(object sender, EventArgs e)
    {
        webBrowser1.Navigate(textBox1.Text);
    }

    private void button2_Click(object sender, EventArgs e)
    {
        webBrowser1.Navigate(textBox2.Text);
    }

}

static class Program
{
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        try
        {
            Application.Run(new Form1());
        } catch (Exception ex)
        {
            string msg = ex.Message;
        }
    }
}
}

Upvotes: 2

Views: 7046

Answers (6)

Surce
Surce

Reputation: 36

I got the same problem with an application on Windows 10, it works fine on Windows XP / Vista / 7 / 8 / 8.1 and even in fresh installs of Windows 10, but after a few hours it stops working.

The application was developed on Visual Studio 2010 and switched up to Visual Studio 2013 Ultimate thinking that it could be an Edge / ActiveX incompatibility problem but no :(

Update

The issue is fixed in this update from Microsoft. The bug was some flash incompatibility with activeX.

Upvotes: 2

pmoleri
pmoleri

Reputation: 4449

As StefanBelo's answer the problem was Windows update for Flash (KB3132372).

Now the problem is solved in KB3133431. Just run your Windows updates and the problem should be fixed (it did for me).

Upvotes: 0

paololabe
paololabe

Reputation: 1

About me the problems appears only when the webbrowser component load a youtube video by the youtube iframe api. This was driving me crazy, couse some days ago everything was perfect. Confirm that the solution is removing KB3132372 using wusa.exe /uninstall /kb:3132372 /norestart /quiet

Thanks a lot.

Upvotes: -2

Leonardo Daga
Leonardo Daga

Reputation: 145

Maybe it helps.

I have almost the same problem about an application I developed that uses the webBrowser control. In this application I enabled the browser emulation, letting the user select the browser to use to visualize the website.
The browser emulation code sets the registry item:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

with a key that contains the name of the application and a value that select the browser to emulate. (8000d for IE8, 9000 for IE9, 11001 for Edge).

Few days ago, the application started to crash, without any modification to the SW. After one and half days of investigation I've found the following rules:

  • When the key is selected, the browser crashes together with my application.
  • When the key is not selected, the application doesn't crashes but it emulates an old release of IE.

I'm still investigating on this topic, if I find something more I'll publish here.

Anyway, removing the KB3132372 the problem is solved, but this KB is loaded automatically on Win10, than it's potentially desruptive if the user is not aware of the problem.

Important suggestion about KB3132372 to disable further upload of this update: it's causing many problems in many applications based on the webBrowser control. You can suggest your clients to remove it and also to use the Windows Update Show/Hide utility to hide the update (see https://support.microsoft.com/en-au/kb/3073930) because otherwise it upload again every automatic upload.

Upvotes: 2

EminST
EminST

Reputation: 79

I have the same problem with the webbrowser control on W8/W10, when it navigates to page which contains ActiveX(Flash).

Currently only solution to remove KB3132372 windows update. It`s can be made by cmd command:

wusa.exe /uninstall /kb:3132372 /norestart /quiet

Unfortunately Windows 8/10 will try to install it again in future. By this reason is also possible to hide this update as shown here

Upvotes: 2

StefanBelo
StefanBelo

Reputation: 39

I have got the same problem, my app was running for months without problems, those days after mentioned Microsoft update had been installed:

Windows update for Flash (KB3132372)

My app crashed when dialog with embedded browser has been opened. Strange thing is that presented web page has no flash elements, after uninstalling this update (KB3132372) all works fine again.

Upvotes: 1

Related Questions