mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Blank Page with Blazor (ASP.NET Core hosted) Preview 6 #348
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 @MaherJendoubi on GitHub (Jun 16, 2019).
dotnet --version
3.0.100-preview6-012264
Steps to Reproduce:
The result is the following:
@MaherJendoubi commented on GitHub (Jun 17, 2019):
electronize start
Start Electron Desktop Application...
Microsoft Windows [version 10.0.18362.175]
(c) 2019 Microsoft Corporation. Tous droits réservés.
C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server>dotnet publish -r win-x64 --output "C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server\obj\Host\bin"
Microsoft (R) Build Engine version 16.2.0-preview-19278-01+d635043bd pour .NET Core
Copyright (C) Microsoft Corporation. Tous droits réservés.
Restauration effectuée dans 19,34 ms pour C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Client\WebApplication20.Client.csproj.
Restauration effectuée dans 19,21 ms pour C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Shared\WebApplication20.Shared.csproj.
Restauration effectuée dans 23,89 ms pour C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server\WebApplication20.Server.csproj.
C:\Program Files\dotnet\sdk\3.0.100-preview6-012264\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(158,5): message : NETSDK1057 : Vous utilisez une préversion de .NET Core. Voir : https://aka.ms/dotnet-core-preview [C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server\WebApplication20.Server.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview6-012264\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(158,5): message : NETSDK1057 : Vous utilisez une préversion de .NET Core. Voir : https://aka.ms/dotnet-core-preview [C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Shared\WebApplication20.Shared.csproj]
WebApplication20.Shared -> C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Shared\bin\Debug\netstandard2.0\WebApplication20.Shared.dll
WebApplication20.Client -> C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Client\bin\Debug\netstandard2.0\WebApplication20.Client.dll
Blazor Build result -> 33 files in C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Client\bin\Debug\netstandard2.0\dist
WebApplication20.Server -> C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server\bin\Debug\netcoreapp3.0\win-x64\WebApplication20.Server.dll
WebApplication20.Server -> C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server\obj\Host\bin
C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server>
Skip npm install, because node_modules directory exists in: C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server\obj\Host\node_modules
Invoke electron.cmd - in dir: C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server\obj\Host\node_modules.bin
Microsoft Windows [version 10.0.18362.175]
(c) 2019 Microsoft Corporation. Tous droits réservés.
C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server\obj\Host\node_modules.bin>electron.cmd "....\main.js"
stdout: Use Electron Port: 8000
stdout: info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available. Using 'C:\Users\Maher\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
ASP.NET Core Application connected... global.electronsocket GLstc8UetcSP0PiFAAAA 2019-06-17T22:08:12.520Z
stdout: Hosting environment: Production
Content root path: C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server\obj\Host\bin
Now listening on: http://localhost:8001
Application started. Press Ctrl+C to shut down.
stdout: BridgeConnector connected!
stdout: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:8001/
stdout: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'Fallback {*path:nonfile}'
stdout: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'Fallback {*path:nonfile}'
stdout: info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 29.200300000000002ms 404
C:\Users\Maher\source\repos\WebApplication20\WebApplication20.Server\obj\Host\node_modules.bin>
@robertmclaws commented on GitHub (Jul 6, 2019):
Any luck with this yet?
@robertmclaws commented on GitHub (Jul 7, 2019):
I spent a few hours yesterday digging into this issue, and I figured it out. It really has nothing to do with Electron.NET, and everything to do with the changes they made to the Endpoint Routing. With the Preview 6 changes, not all of the files were exposed to the Host, and the ones that were weren't in the right spot.
After a few hours of testing, I was able to get everything working and into a NuGet package that could handle the changes. I didn't make a PR here yet because it requires VS2019, and I didn't want to force that upgrade on the project without asking. So for now, it's in my own repo.
If you get a chance, please test it out (instructions are on the repo home page) and let me know if it works for you. Then we can discuss if it needs to move.
Thanks!
@MaherJendoubi commented on GitHub (Jul 7, 2019):
@robertmclaws I really appreciate your great effort digging into this issue.
It works like a charm !
Thanks !
@robertmclaws commented on GitHub (Jul 7, 2019):
Since this was not an Electron.NE issue, but an ASP.NET Core routing issue, you can feel free to close this bug.
@GregorBiswanger commented on GitHub (Jul 8, 2019):
@robertmclaws Thank you very much for your support!
The native Blazor support in Electron.NET is important to us. Can you please submit your PR.
@ThuCommix commented on GitHub (Jul 8, 2019):
Nice work @robertmclaws, it would be cool if this would be in the standard extensions provided by electron.net.
@MaherJendoubi commented on GitHub (Jul 29, 2019):
Excuse my ignorance but I cannot see the pull request fixing this issue.
@robertmclaws commented on GitHub (Jul 29, 2019):
That's because one is no longer required. Either Microsoft or this team fixed the issue, and the package is no longer necessary. I've updated ElectronNET.Blazor for Preview 7 to restore the original behavior without breaking anyone who already installed it. I'm not recommending anyone remove it yet, in case something breaks between now and Blazor RTM, but I'll put a note in the readme.txt file when it's safe to uninstall the package.
@MaherJendoubi commented on GitHub (Jul 29, 2019):
@robertmclaws Thank you for the answer.