mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Update Readme to add guidance when using .NET 6 Minimal API Program.cs #713
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 @schaveyt on GitHub (Oct 17, 2021).
.NET 6 templates are now using the minimal APIs syntax by default. However the existing IWebBuilder extension method is not compatible as the new WebApplicationBuilder ASP.NET class
I propose adding an additional guidance to the Readme:
@schaveyt commented on GitHub (Oct 18, 2021):
Actually, I am now finding this only works when running
electronize start /watchas the /watch option start the .net process using thedotnet watch runstyle. When one attempts to run aselectronize start, ElectronNET.API's UseElectron extension method attempts to change the ContentRoot and goes 💥 and throw the following exception:This is due to this line her of the ElectronNET.API:
c2a8c627b9/ElectronNET.API/WebHostBuilderExtensions.cs (L46)There, does, in fact appear to be a change in behavior for .net6 when using the Minimal.API vs the .net5 style startup as evidence here on the github issue: https://github.com/dotnet/aspnetcore/issues/36876#issuecomment-925894121 by @davidfowl
Base on this and the his related pull request, it does look as if Minimal API can support the current approach. I even tried what one of asp.net test did with no luck:
@schaveyt commented on GitHub (Oct 18, 2021):
I did confirm that running the .net6 SDK command does still works with ElectronNET as it generates the traditional Program.cs and Startup.cs 👍 :
@schaveyt commented on GitHub (Oct 18, 2021):
😡 Just discovered that the amazing hot reload feature in
dotnet watchonly works when no arguments are passed to it.c7c4e5d11b/src/BuiltInTools/dotnet-watch/Program.cs (L299)Only the following two command will permit the hot reload to activate:
This impacts the experience for ElectronNET users, as the
electronize start /watchcall dotnet like this:@schaveyt commented on GitHub (Dec 28, 2021):
Withdrawing this change request.