Skip to content

Commit 4a2a478

Browse files
committed
Should never use async void, also .Start() and .RunSynchronoulsy() seems to deadlock
1 parent 0ad6358 commit 4a2a478

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static IWebHost BuildWebHost(string[] args)
3838
Open the Electron Window in the Startup.cs file:
3939

4040
```csharp
41-
public async void Configure(IApplicationBuilder app, IHostingEnvironment env)
41+
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
4242
{
4343
if (env.IsDevelopment())
4444
{
@@ -60,7 +60,7 @@ public async void Configure(IApplicationBuilder app, IHostingEnvironment env)
6060
});
6161

6262
// Open the Electron-Window here
63-
await Electron.WindowManager.CreateWindowAsync();
63+
Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());
6464
}
6565
```
6666

0 commit comments

Comments
 (0)