Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform detection is not differentiating between x64 and arm64 OSX platform #820

Closed
sajmonr opened this issue Nov 3, 2023 · 1 comment · Fixed by #821
Closed

Platform detection is not differentiating between x64 and arm64 OSX platform #820

sajmonr opened this issue Nov 3, 2023 · 1 comment · Fixed by #821
Labels

Comments

@sajmonr
Copy link
Contributor

sajmonr commented Nov 3, 2023

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
@sajmonr sajmonr added the bug label Nov 3, 2023
@sajmonr
Copy link
Contributor Author

sajmonr commented Nov 3, 2023

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.

@sajmonr sajmonr changed the title Application will not start in electron on arm64 Mac Platform detection is not differentiating between x64 and arm64 OSX platform Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant