Skip to content

Commit 820d7bb

Browse files
authored
Merge pull request #1087 from epsitec-sa/bug/#1084
Bug/#1084 - Visual studio loading issue
2 parents 95089e1 + 5eeab1b commit 820d7bb

7 files changed

Lines changed: 34 additions & 21 deletions

File tree

‎Directory.Packages.props‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!-- This file prevents unintended imports of unrelated MSBuild files -->
5+
<!-- Uncomment to include parent Directory.Packages.props file -->
6+
<!--<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Packages.props', '$(MSBuildThisFileDirectory)../'))" />-->
7+
8+
</Project>

‎src/ElectronNET.AspNet/Runtime/Controllers/RuntimeControllerAspNetBase.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private async Task RunReadyCallback()
145145
catch (Exception ex)
146146
{
147147
Console.WriteLine("Exception while executing OnAppReadyCallback. Stopping...\n" + ex);
148-
this.Stop();
148+
_ = this.Stop();
149149
}
150150
}
151151
}

‎src/ElectronNET.WebApp/ElectronNET.WebApp.csproj‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
<ElectronSplashScreen>wwwroot\assets\img\about@2x.png</ElectronSplashScreen>
3535
<License>MIT</License>
3636
<ElectronSingleInstance>false</ElectronSingleInstance>
37-
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
3837
<ElectronBuilderVersion>26.0</ElectronBuilderVersion>
3938
</PropertyGroup>
4039
<PropertyGroup>

‎src/ElectronNET/build/ElectronNET.Core.props‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
<PropertyGroup Label="ElectronNetCommon">
55
<ElectronVersion>30.4.0</ElectronVersion>
66
<ElectronBuilderVersion>26.0</ElectronBuilderVersion>
7-
<!-- Default to the host SDK's RID (e.g. linux-x64, win-x64, osx-arm64) when none is passed,
8-
so `dotnet build/publish` without -r targets the current OS. -->
9-
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</RuntimeIdentifier>
7+
<!-- Ensure runtime identifier can be overloaded -->
8+
<ElectronRuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''" />
9+
<!-- Using dotnet cli, itself builded with core runtime, we can access a self contained property with the runtime identifier -->
10+
<ElectronRuntimeIdentifier Condition="'$(ElectronRuntimeIdentifier)' == '' AND '$(MSBuildRuntimeType)' == 'Core'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</ElectronRuntimeIdentifier>
11+
<!-- Otherwhise Full target framework is only available on Windows systems -->
12+
<ElectronRuntimeIdentifier Condition="'$(ElectronRuntimeIdentifier)' == '' AND '$(MSBuildRuntimeType)' == 'Full'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLower())</ElectronRuntimeIdentifier>
1013
<ElectronSingleInstance>true</ElectronSingleInstance>
1114
<ElectronSplashScreen></ElectronSplashScreen>
1215
<ElectronIcon></ElectronIcon>

‎src/ElectronNET/build/ElectronNET.LateImport.targets‎

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<!-- Electron Builder uses title for the installation dir on Linux, but it should not have spaces -->
122122
<LinuxPrefix>linux</LinuxPrefix>
123123
<ElectronTitle>$(Title)</ElectronTitle>
124-
<ElectronTitle Condition="'$(RuntimeIdentifier.StartsWith($(LinuxPrefix)))' == 'true'">$(Title.Replace(' ', '-'))</ElectronTitle>
124+
<ElectronTitle Condition="'$(ElectronRuntimeIdentifier.StartsWith($(LinuxPrefix)))' == 'true'">$(Title.Replace(' ', '-'))</ElectronTitle>
125125
</PropertyGroup>
126126

127127
<ItemGroup>
@@ -365,18 +365,18 @@
365365
<Target Name="ElectronCheckVersionMismatch">
366366

367367
<PropertyGroup>
368-
<ElectronArch Condition="'$(RuntimeIdentifier)' == 'win-x64'">x64</ElectronArch>
369-
<ElectronArch Condition="'$(RuntimeIdentifier)' == 'win-x86'">ia32</ElectronArch>
370-
<ElectronArch Condition="'$(RuntimeIdentifier)' == 'win-arm64'">arm64</ElectronArch>
371-
<ElectronArch Condition="'$(RuntimeIdentifier)' == 'linux-x64'">x64</ElectronArch>
372-
<ElectronArch Condition="'$(RuntimeIdentifier)' == 'linux-arm'">armv7l</ElectronArch>
373-
<ElectronArch Condition="'$(RuntimeIdentifier)' == 'linux-arm64'">arm64</ElectronArch>
374-
<ElectronArch Condition="'$(RuntimeIdentifier)' == 'osx-x64'">x64</ElectronArch>
375-
<ElectronArch Condition="'$(RuntimeIdentifier)' == 'osx-arm64'">arm64</ElectronArch>
376-
377-
<ElectronPlatform Condition="'$(RuntimeIdentifier)' == 'win-x64' OR '$(RuntimeIdentifier)' == 'win-x86' OR '$(RuntimeIdentifier)' == 'win-arm64'">win</ElectronPlatform>
378-
<ElectronPlatform Condition="'$(RuntimeIdentifier)' == 'linux-x64' OR '$(RuntimeIdentifier)' == 'linux-arm' OR '$(RuntimeIdentifier)' == 'linux-arm64'">linux</ElectronPlatform>
379-
<ElectronPlatform Condition="'$(RuntimeIdentifier)' == 'osx-x64' OR '$(RuntimeIdentifier)' == 'osx-arm64'">mac</ElectronPlatform>
368+
<ElectronArch Condition="'$(ElectronRuntimeIdentifier)' == 'win-x64'">x64</ElectronArch>
369+
<ElectronArch Condition="'$(ElectronRuntimeIdentifier)' == 'win-x86'">ia32</ElectronArch>
370+
<ElectronArch Condition="'$(ElectronRuntimeIdentifier)' == 'win-arm64'">arm64</ElectronArch>
371+
<ElectronArch Condition="'$(ElectronRuntimeIdentifier)' == 'linux-x64'">x64</ElectronArch>
372+
<ElectronArch Condition="'$(ElectronRuntimeIdentifier)' == 'linux-arm'">armv7l</ElectronArch>
373+
<ElectronArch Condition="'$(ElectronRuntimeIdentifier)' == 'linux-arm64'">arm64</ElectronArch>
374+
<ElectronArch Condition="'$(ElectronRuntimeIdentifier)' == 'osx-x64'">x64</ElectronArch>
375+
<ElectronArch Condition="'$(ElectronRuntimeIdentifier)' == 'osx-arm64'">arm64</ElectronArch>
376+
377+
<ElectronPlatform Condition="'$(ElectronRuntimeIdentifier)' == 'win-x64' OR '$(ElectronRuntimeIdentifier)' == 'win-x86' OR '$(ElectronRuntimeIdentifier)' == 'win-arm64'">win</ElectronPlatform>
378+
<ElectronPlatform Condition="'$(ElectronRuntimeIdentifier)' == 'linux-x64' OR '$(ElectronRuntimeIdentifier)' == 'linux-arm' OR '$(ElectronRuntimeIdentifier)' == 'linux-arm64'">linux</ElectronPlatform>
379+
<ElectronPlatform Condition="'$(ElectronRuntimeIdentifier)' == 'osx-x64' OR '$(ElectronRuntimeIdentifier)' == 'osx-arm64'">mac</ElectronPlatform>
380380

381381
<!-- npm uses different OS names than Electron -->
382382
<NpmOs Condition="'$(ElectronPlatform)' == 'win'">win32</NpmOs>
@@ -385,7 +385,7 @@
385385

386386
<!-- npm CPU is same as ElectronArch except for linux-arm -->
387387
<NpmCpu>$(ElectronArch)</NpmCpu>
388-
<NpmCpu Condition="'$(RuntimeIdentifier)' == 'linux-arm'">arm</NpmCpu>
388+
<NpmCpu Condition="'$(ElectronRuntimeIdentifier)' == 'linux-arm'">arm</NpmCpu>
389389

390390
<_CurrentOSPlatform Condition="$([MSBuild]::IsOSPlatform('Windows'))">win</_CurrentOSPlatform>
391391
<_CurrentOSPlatform Condition="$([MSBuild]::IsOSPlatform('Linux'))">linux</_CurrentOSPlatform>
@@ -522,7 +522,7 @@
522522

523523
<Error Condition="'$(_IsPlatformMismatch)' == 'true'"
524524
Code="ELECTRON100"
525-
Text="The target RuntimeIdentifier '$(RuntimeIdentifier)' (platform: $(ElectronPlatform)) does not match the current operating system ($(_CurrentOSPlatform)).
525+
Text="The target RuntimeIdentifier '$(ElectronRuntimeIdentifier)' (platform: $(ElectronPlatform)) does not match the current operating system ($(_CurrentOSPlatform)).
526526
527527
Electron applications must be built on the target operating system:
528528
- Windows targets (win-x64, win-x86, win-arm64) must be built on Windows
@@ -645,7 +645,10 @@ For more information, see: https://github.com/ElectronNET/Electron.NET/wiki/Migr
645645
</PropertyGroup>
646646

647647
<PropertyGroup>
648-
<_NpxCmd>npx electron-builder --config=./$(ElectronBuilderJson) --$(ElectronPlatform) --$(ElectronArch) -c.electronVersion=$(ElectronVersion) -c.directories.output &quot;$(ElectronPublishUrlFullPath)&quot; $(ElectronPaParams)</_NpxCmd>
648+
<_NpxCmd>npx electron-builder --config=./$(ElectronBuilderJson)</_NpxCmd>
649+
<_NpxCmd Condition="'$(IsLinuxWsl)' == 'true'">$(_NpxCmd) --$(ElectronPlatform)</_NpxCmd>
650+
<_NpxCmd Condition="'$(IsLinuxWsl)' == 'true'">$(_NpxCmd) --$(ElectronArch)</_NpxCmd>
651+
<_NpxCmd>$(_NpxCmd) -c.electronVersion=$(ElectronVersion) -c.directories.output &quot;$(ElectronPublishUrlFullPath)&quot; $(ElectronPaParams)</_NpxCmd>
649652
<_NpxCmd Condition="'$(IsLinuxWsl)' == 'true'">wsl bash -ic '$(_NpxCmd)'</_NpxCmd>
650653
</PropertyGroup>
651654

0 commit comments

Comments
 (0)