Getting stuck with building win .exe on macos (Also with /PublishReadyToRun false) #668

Closed
opened 2026-01-29 16:45:35 +00:00 by claunia · 5 comments
Owner

Originally created by @Mondonno on GitHub (Jun 14, 2021).

Originally assigned to: @GregorBiswanger on GitHub.

  • Version: 11.5.1.0

Node: 12.14.1
.NET: 5.0.203

  • Target: Windows (the same error when building for Linux)
    When building for osx it is fine

Steps to Reproduce:

  1. Get on macos laptop
  2. Init new project in electron
  3. Build it: electronize /target win /PublishReadyToRun false
  4. Error
    If i do not type /PublishReadyToRun i getting NETSDK1095 error #446 Switch to another socket.io for c# lib (#464)

Comment

The error content and stack trace:

electronize build /target win /PublishReadyToRun false
Build Electron Application...
Build ASP.NET Core App for linux-x64...
Executing dotnet publish in this directory: /Users/x/Documents/Project/obj/desktop/linux
Build ASP.NET Core App for linux-x64 under Release-Configuration...
Microsoft (R) Build Engine 16.9.0+57a23d249 dla platformy .NET
Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone.
  Trwa określanie projektów do przywrócenia...
  Wszystkie projekty są aktualne na potrzeby przywrócenia.
  Project -> /Users/x/Documents/Project/bin/Release/net5.0/linux-x64/Project.dll
  Project -> /Users/x/Documents/Project/bin/Release/net5.0/linux-x64/Project.Views.dll
  Project -> /Users/x/Documents/Project/obj/desktop/linux/bin/
Start npm install...
npm WARN deprecated tslint@6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated @types/socket.io-parser@3.0.0: This is a stub types definition. socket.io-parser provides its own type definitions, so you do not need this installed.
npm notice created a lockfile as package-lock.json. You should commit this file.
added 67 packages from 57 contributors and audited 186 packages in 7.232s
found 0 vulnerabilities
ElectronHostHook handling started...
Build Electron Desktop Application...
Executing electron magic in this directory: /Users/x/Documents/Project/bin/desktop
Create electron-builder configuration file...
Package Electron App for Platform linux...
npx: zainstalowano 240 w 24.789s
Cannot find module 'fs/promises'
Require stack:
- /Users/x/.npm/_npx/1236/lib/node_modules/electron-builder/node_modules/builder-util/out/fs.js
- /Users/x/.npm/_npx/1236/lib/node_modules/electron-builder/node_modules/builder-util/out/util.js
- /Users/x/.npm/_npx/1236/lib/node_modules/electron-builder/out/cli/cli.js
- /Users/x/.npm/_npx/1236/lib/node_modules/electron-builder/cli.js
... done

also electronize start works fine.

Originally created by @Mondonno on GitHub (Jun 14, 2021). Originally assigned to: @GregorBiswanger on GitHub. <!-- Please search existing issues to avoid creating duplicates. --> <!-- Which version of Electron.NET CLI and API are you using? --> <!-- Please always try to use latest version before report. --> * **Version**: 11.5.1.0 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> **Node**: 12.14.1 **.NET**: 5.0.203 <!-- What target are you building for? --> * **Target**: Windows (the same error when building for Linux) *When building for osx it is fine* <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> Steps to Reproduce: 1. Get on macos laptop 2. Init new project in electron 3. Build it: `electronize /target win /PublishReadyToRun false` 4. Error *If i do not type /PublishReadyToRun i getting `NETSDK1095` error* #446 #464 **Comment** The error content and stack trace: ``` electronize build /target win /PublishReadyToRun false Build Electron Application... Build ASP.NET Core App for linux-x64... Executing dotnet publish in this directory: /Users/x/Documents/Project/obj/desktop/linux Build ASP.NET Core App for linux-x64 under Release-Configuration... Microsoft (R) Build Engine 16.9.0+57a23d249 dla platformy .NET Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone. Trwa określanie projektów do przywrócenia... Wszystkie projekty są aktualne na potrzeby przywrócenia. Project -> /Users/x/Documents/Project/bin/Release/net5.0/linux-x64/Project.dll Project -> /Users/x/Documents/Project/bin/Release/net5.0/linux-x64/Project.Views.dll Project -> /Users/x/Documents/Project/obj/desktop/linux/bin/ Start npm install... npm WARN deprecated tslint@6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information. npm WARN deprecated @types/socket.io-parser@3.0.0: This is a stub types definition. socket.io-parser provides its own type definitions, so you do not need this installed. npm notice created a lockfile as package-lock.json. You should commit this file. added 67 packages from 57 contributors and audited 186 packages in 7.232s found 0 vulnerabilities ElectronHostHook handling started... Build Electron Desktop Application... Executing electron magic in this directory: /Users/x/Documents/Project/bin/desktop Create electron-builder configuration file... Package Electron App for Platform linux... npx: zainstalowano 240 w 24.789s Cannot find module 'fs/promises' Require stack: - /Users/x/.npm/_npx/1236/lib/node_modules/electron-builder/node_modules/builder-util/out/fs.js - /Users/x/.npm/_npx/1236/lib/node_modules/electron-builder/node_modules/builder-util/out/util.js - /Users/x/.npm/_npx/1236/lib/node_modules/electron-builder/out/cli/cli.js - /Users/x/.npm/_npx/1236/lib/node_modules/electron-builder/cli.js ... done ``` also `electronize start` works fine.
claunia added the bug label 2026-01-29 16:45:35 +00:00
Author
Owner

@izakntun commented on GitHub (Jun 14, 2021):

I have the same issue last week, the solution was updated NodeJS to the latest version, I used version 10.16 Node and now I have version 14.17 Node.

@izakntun commented on GitHub (Jun 14, 2021): I have the same issue last week, the solution was updated NodeJS to the latest version, I used version 10.16 Node and now I have version 14.17 Node.
Author
Owner

@Mondonno commented on GitHub (Jun 15, 2021):

@izakntun Ok, after upgrading my node to lastest stable version, i got correct executable. But there is still a bug, you need to put: /PublishReadyToRun false in order to build app to any other system than macos.

I think the @GregorBiswanger sholud have a look on this 👍

Edit 15.06.2021 The builds does not works on the targeted systems

@Mondonno commented on GitHub (Jun 15, 2021): @izakntun Ok, after upgrading my node to lastest stable version, i got correct executable. But there is still a bug, you need to put: `/PublishReadyToRun false` in order to build app to any other system than macos. I think the @GregorBiswanger sholud have a look on this 👍 **Edit** `15.06.2021` The builds does not works on the targeted systems
Author
Owner

@tub5 commented on GitHub (Jul 1, 2021):

@Mondonno the publish ready issue is already fixed with #570

@tub5 commented on GitHub (Jul 1, 2021): @Mondonno the publish ready issue is already fixed with #570
Author
Owner

@Mondonno commented on GitHub (Jul 12, 2021):

@tub5 Thats very good! So it got fixed 1.07.2021 after 17 days of my issue. But still builds does not works on targeted systems

EDIT 17.09.2021 So i added filed to electron manifest and it crashed. Now building works

@Mondonno commented on GitHub (Jul 12, 2021): @tub5 Thats very good! So it got fixed 1.07.2021 after 17 days of my issue. But still builds does not works on targeted systems **EDIT** `17.09.2021` So i added filed to electron manifest and it crashed. Now building works
Author
Owner

@GregorBiswanger commented on GitHub (Mar 28, 2023):

🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉

With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!

@GregorBiswanger commented on GitHub (Mar 28, 2023): 🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉 With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#668