[PR #31] [MERGED] Should never use async void #1056

Closed
opened 2026-01-29 16:56:59 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ElectronNET/Electron.NET/pull/31
Author: @tebeco
Created: 11/3/2017
Status: Merged
Merged: 11/4/2017
Merged by: @robertmuehsig

Base: masterHead: removing_async_void


📝 Commits (1)

  • 4a2a478 Should never use async void, also .Start() and .RunSynchronoulsy() seems to deadlock

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 README.md (+2 -2)

📄 Description

Should never use async void

I tried other scenario but that seems to endup in deadlock or the WebHostBuilder is not happy
I ended up avoiding

Not working so far:

public async Task Configure(IApplicationBuilder app, IHostingEnvironment env)
{
  await Electron.WindowManager.CreateWindowAsync()
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
  Electron.WindowManager.CreateWindowAsync().Start()
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
  Electron.WindowManager.CreateWindowAsync().RunSynchronously()
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ElectronNET/Electron.NET/pull/31 **Author:** [@tebeco](https://github.com/tebeco) **Created:** 11/3/2017 **Status:** ✅ Merged **Merged:** 11/4/2017 **Merged by:** [@robertmuehsig](https://github.com/robertmuehsig) **Base:** `master` ← **Head:** `removing_async_void` --- ### 📝 Commits (1) - [`4a2a478`](https://github.com/ElectronNET/Electron.NET/commit/4a2a4788c8e456b543d8b139fb3f6964acdc82d1) Should never use async void, also .Start() and .RunSynchronoulsy() seems to deadlock ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+2 -2) </details> ### 📄 Description Should never use async void I tried other scenario but that seems to endup in deadlock or the WebHostBuilder is not happy I ended up avoiding Not working so far: ```csharp public async Task Configure(IApplicationBuilder app, IHostingEnvironment env) { await Electron.WindowManager.CreateWindowAsync() } ``` ```csharp public void Configure(IApplicationBuilder app, IHostingEnvironment env) { Electron.WindowManager.CreateWindowAsync().Start() } ``` ```csharp public void Configure(IApplicationBuilder app, IHostingEnvironment env) { Electron.WindowManager.CreateWindowAsync().RunSynchronously() } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 16:56:59 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1056