Fails to start #212

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

Originally created by @xlar54 on GitHub (Sep 21, 2018).

Originally assigned to: @GregorBiswanger on GitHub.

I follow this tutorial:

https://www.youtube.com/watch?v=nuM6AojRFHk

And get:
C:\Users\me\work-csharp\myapp>dotnet electronize start
Start Electron Desktop Application...
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\me\work-csharp\myapp>dotnet publish -r win-x64 --output "C:\Users\me\work-csharp\myapp\obj\Host\bin"
Microsoft (R) Build Engine version 15.6.84.34536 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 56.89 ms for C:\Users\me\work-csharp\myapp\myapp.csproj.
Restore completed in 71.07 ms for C:\Users\me\work-csharp\myapp\myapp.csproj.
Restoring packages for C:\Users\me\work-csharp\myapp\myapp.csproj...
Restore completed in 1.16 sec for C:\Users\me\work-csharp\myapp\myapp.csproj.
Program.cs(23,18): error CS1061: 'IWebHostBuilder' does not contain a definition for 'UseElectron' and no extension method 'UseElectron' accepting a first argument of type 'IWebHostBuilder' could be found (are you missing a using directive or an assembly reference?) [C:\Users\me\work-csharp\myapp\myapp.csproj]
Startup.cs(54,19): error CS0103: The name 'Electron' does not exist in the current context [C:\Users\me\work-csharp\myapp\myapp.csproj]
C:\Users\me\work-csharp\myapp>
Error occurred during dotnet publish.

Originally created by @xlar54 on GitHub (Sep 21, 2018). Originally assigned to: @GregorBiswanger on GitHub. I follow this tutorial: https://www.youtube.com/watch?v=nuM6AojRFHk And get: C:\Users\me\work-csharp\myapp>dotnet electronize start Start Electron Desktop Application... Microsoft Windows [Version 10.0.15063] (c) 2017 Microsoft Corporation. All rights reserved. C:\Users\me\work-csharp\myapp>dotnet publish -r win-x64 --output "C:\Users\me\work-csharp\myapp\obj\Host\bin" Microsoft (R) Build Engine version 15.6.84.34536 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Restore completed in 56.89 ms for C:\Users\me\work-csharp\myapp\myapp.csproj. Restore completed in 71.07 ms for C:\Users\me\work-csharp\myapp\myapp.csproj. Restoring packages for C:\Users\me\work-csharp\myapp\myapp.csproj... Restore completed in 1.16 sec for C:\Users\me\work-csharp\myapp\myapp.csproj. Program.cs(23,18): error CS1061: 'IWebHostBuilder' does not contain a definition for 'UseElectron' and no extension method 'UseElectron' accepting a first argument of type 'IWebHostBuilder' could be found (are you missing a using directive or an assembly reference?) [C:\Users\me\work-csharp\myapp\myapp.csproj] Startup.cs(54,19): error CS0103: The name 'Electron' does not exist in the current context [C:\Users\me\work-csharp\myapp\myapp.csproj] C:\Users\me\work-csharp\myapp> Error occurred during dotnet publish.
claunia added the question label 2026-01-29 16:33:59 +00:00
Author
Owner

@xlar54 commented on GitHub (Sep 21, 2018):

Seems it doesnt like the:

await Electron.WindowManager.CreateWindowAsync();

in Startup.cs

and

UseElectron (args)

in:

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup()
.UseElectron(args)
.Build();

@xlar54 commented on GitHub (Sep 21, 2018): Seems it doesnt like the: await Electron.WindowManager.CreateWindowAsync(); in Startup.cs and UseElectron (args) in: public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .UseElectron(args) .Build();
Author
Owner

@GregorBiswanger commented on GitHub (Sep 25, 2018):

Hello @xlar54

works now?

Best,
Gregor

@GregorBiswanger commented on GitHub (Sep 25, 2018): Hello @xlar54 works now? Best, Gregor
Author
Owner

@sshanzel commented on GitHub (Jan 14, 2020):

This still doesn't work. Just like the steps in the README

@sshanzel commented on GitHub (Jan 14, 2020): This still doesn't work. Just like the steps in the README
Author
Owner

@Spoomer commented on GitHub (May 23, 2020):

try to add "using ElectronNET.API;" to both files

@Spoomer commented on GitHub (May 23, 2020): try to add "using ElectronNET.API;" to both files
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#212