ElectronNET / Electron.NET

:electron: Build cross platform desktop apps with ASP.NET Core (Razor Pages, MVC, Blazor).

Home Page:https://gitter.im/ElectronNET/community

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Platform detection is not differentiating between x64 and arm64 OSX platform

sajmonr opened this issue · comments

commented

Electron.NET CLI and API version: 23.6.1
.NET Core version: I have tried both 6.x and 7.x and both give the same result.

Target build: macOS 14.1 (arm64)

I am using MacBook Pro with M2 Max (I am suspicious that this issue will be on any arm based Mac, however, I cannot confirm this.)

I created a Blazor server application with ElectronNET in it. The application itself works fine when running with regular botnet run command, however, when I try electronize start the web application will not start.

The electron process seems to start - I can see the electron icon in the dock and I can cmd + Q to quit it (which terminates the process) but I cannot see any window and the normal web app output is not shown in the console. The only thing in the console is the electron start output and then it stops.

Start Electron Desktop Application...
Arguments: 
	
dotnet publish -r osx-x64 -c "Debug" --output "/Users/adamsimonicek/RiderProjects/BlazorApp1/BlazorApp1/obj/Host/bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --no-self-contained
MSBuild version 17.7.3+8ec440e68 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  BlazorApp1 -> /Users/adamsimonicek/RiderProjects/BlazorApp1/BlazorApp1/bin/Debug/net7.0/osx-x64/BlazorApp1.dll
  BlazorApp1 -> /Users/adamsimonicek/RiderProjects/BlazorApp1/BlazorApp1/obj/Host/bin/


node_modules missing in: /Users/adamsimonicek/RiderProjects/BlazorApp1/BlazorApp1/obj/Host/node_modules
Start npm install...
npm install

up to date, audited 157 packages in 318ms

25 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


ElectronHostHook handling started...
Invoke electron - in dir: /Users/adamsimonicek/RiderProjects/BlazorApp1/BlazorApp1/obj/Host/node_modules/.bin
./electron "../../main.js" 
2023-11-03 08:45:18.563 Electron[58481:4452485] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
Electron Socket IO Port: 8000
Electron Socket started on port 8000 at ::1
ASP.NET Core Port: 8002
ASP.NET Core Application connected... global.electronsocket Jr94dROIY9UQY_EgAAAB 2023-11-03T12:45:20.678Z

Steps to reproduce:

  1. Create a Blazor server application with ElectronNET in it
  2. Run electronize start
commented

I found a solution from a closed issue #776 (I missed it the first time) and it seems that works. Looking at it further, the problem seems to be that the platform auto detection is not checking whether osx is x64 or arm64.

The workaround, as mentioned in the issue, is to use /target custom "osx-arm64;mac" OR to install the x64 SDK binaries for whatever framework you are targeting.