Skip to content

[🐛 Bug]: Entire application crash in case of unhandled exception in async void method #12480

@nvborisenko

Description

@nvborisenko

What happened?

Application is crashed.

How can we reproduce the issue?

Open `youtube.com` with enabled network monitoring.


var net = driver.Manage().Network;

        net.NetworkRequestSent += (sender, e) =>
        {
            //Console.WriteLine(e.RequestUrl);
        };

Relevant log output

Running selected tests in D:\Temp\aaa\bin\Debug\net7.0\aaa.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
The active test run was aborted. Reason: Test host process crashed : Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at aaa.UnitTest1.<>c__DisplayClass0_0.<Test1>b__2(Object sender, NetworkResponseReceivedEventArgs e) in D:\Temp\aaa\UnitTest1.cs:line 31
   at OpenQA.Selenium.NetworkManager.OnResponsePaused(Object sender, ResponsePausedEventArgs e)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()


### Operating System

any

### Selenium version

any

### What are the browser(s) and version(s) where you see this issue?

any

### What are the browser driver(s) and version(s) where you see this issue?

any

### Are you using Selenium Grid?

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-dotnet.NET BindingsI-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions