mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-09-21 14:35:16 +00:00
Fixed #1050
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
## ElectronNET.Core
|
||||
|
||||
- Fixed token param being appended to external URLs (#1075)
|
||||
- Fixed startup mode discriminator in case of existing `wwwroot` (#1050)
|
||||
- Fixed CA1416 on ASP.NET project (#1091) @epsnm
|
||||
- Fixed loading issue in plain Visual Studio (#1084) @epsnm
|
||||
- Fixed bloated ASAR file (#1080) @epsnm
|
||||
- Improved selection of runtime identifier (#1081) @epsnm
|
||||
- Added more variants for `UseElectron` (#1076) @AeonSake
|
||||
|
||||
# 0.5.1
|
||||
|
||||
@@ -216,14 +216,16 @@
|
||||
|
||||
var webPort = ElectronNetRuntime.AspNetWebPort ?? 0;
|
||||
|
||||
// check for the content folder if its exists in base director otherwise no need to include
|
||||
// It was used before because we are publishing the project which copies everything to bin folder and contentroot wwwroot was folder there.
|
||||
// now we have implemented the live reload if app is run using /watch then we need to use the default project path.
|
||||
// In packaged mode, static content is deployed alongside the app binaries, so we must
|
||||
// point content root to the process base directory. In unpackaged/watch scenarios we
|
||||
// keep the default project content root to preserve live reload behavior.
|
||||
var isPackagedStartup = ElectronNetRuntime.StartupMethod == StartupMethod.PackagedElectronFirst ||
|
||||
ElectronNetRuntime.StartupMethod == StartupMethod.PackagedDotnetFirst;
|
||||
|
||||
// For port 0 (dynamic port assignment), Kestrel requires binding to specific IP (127.0.0.1) not localhost
|
||||
var host = webPort == 0 ? "127.0.0.1" : "localhost";
|
||||
|
||||
if (Directory.Exists($"{AppDomain.CurrentDomain.BaseDirectory}\\wwwroot"))
|
||||
if (isPackagedStartup)
|
||||
{
|
||||
builder = builder.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory)
|
||||
.UseUrls($"http://{host}:{webPort}");
|
||||
|
||||
Reference in New Issue
Block a user