mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Configuration for Program.cs in a .NET 6 project without Startup.cs #834
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sheapa on GitHub (Nov 2, 2022).
Originally assigned to: @GregorBiswanger on GitHub.
The documentation does not explain how to configure the Program.cs file for new .NET 6 projects that don't have Startup.cs.
@alelom commented on GitHub (Nov 17, 2022):
Anyone has got any tips on how to do this?
@alelom commented on GitHub (Nov 17, 2022):
Found an example here: https://learn.microsoft.com/en-us/aspnet/core/migration/50-to-60-samples?view=aspnetcore-7.0#customize-iwebhostbuilder
Which explains how to convert the WebHostBuilder, but not the
app.Run(async () => await Electron.WindowManager.CreateWindowAsync());of https://github.com/ElectronNET/Electron.NET#startupcs.@liebki commented on GitHub (Nov 17, 2022):
Honestly, it didn't work I fiddled with it for about three days, then I just ported it to MAUI 👀. (It, is a project, which used ElectronNet)
@mpelley commented on GitHub (Nov 24, 2022):
I need this also.
@theolivenbaum commented on GitHub (Nov 24, 2022):
@sheapa if you use this fork, you can do something like this:
This will hopefully be merged back to the main repo in the future.
@HalfLegend commented on GitHub (Dec 7, 2022):
It works!! Thanks
When will you merge it?
@OPGL commented on GitHub (Jan 1, 2023):
How i can configure Electron.NET?
@johannesmols commented on GitHub (Jan 16, 2023):
This worked for me: https://github.com/ElectronNET/Electron.NET/issues/685#issuecomment-1252042885
@andrew-locklair commented on GitHub (Feb 24, 2023):
Hi all,
I have this minimal example working with a .NET web application, using top-level statements and no Startup.cs. You shouldn't have to do manual handling to sync Electron, you can just use the WebHost from builder. Here's what it looks like:
@GregorBiswanger commented on GitHub (Feb 24, 2023):
Here's an example from a Blazor Server side app using Electron.NET: