Unable to publish/build on windows #522

Closed
opened 2026-01-29 16:41:50 +00:00 by claunia · 11 comments
Owner

Originally created by @HaydnDias on GitHub (Jul 2, 2020).

Originally assigned to: @GregorBiswanger on GitHub.

  • Version: 9.31.1

Node.js version: 12.18.2 (upgraded from 12.13.1 when the issue started)

  • Target: win

When running electronize build /target win, the build errors out with: Unknown argument: .

This started today after upgrading the dotnet electronnet.cli tool from 5.30.1 -> 9.31.1, I was running it most of the day doing builds and then suddenly with the same commands and without code changes, started getting this issue. I uninstalled and reinstalled, and did a clean setup on a new windows install with the same versions I had previously running and got the same issue.

Running the command npx electron-builder --config=./bin/electron-builder.json --win --x64 -c.electronVersion=9.0.3
(notice the period is removed), results in it working correctly. This happens on our code base on multiple machines (including clean installs) and it happened on your https://github.comElectronNET/electron.net-api-demos too.

C:\GIT\electron.net-api-demos>electronize build /target win
Build Electron Application...
Build ASP.NET Core App for win-x64...
Executing dotnet publish in this directory: C:\GIT\electron.net-api-demos\obj\desktop\win
Build ASP.NET Core App for win-x64 under Release-Configuration...
Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\GIT\electron.net-api-demos>dotnet publish -r win-x64 -c "Release" --output "C:\GIT\electron.net-api-demos\obj\desktop\win\bin" /p:PublishReadyToRun=true --self-contained
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
  Determining projects to restore...
  Restored C:\GIT\electron.net-api-demos\ElectronNET-API-Demos\ElectronNET-API-Demos.csproj (in 1.59 sec).

  ElectronNET-API-Demos -> C:\GIT\electron.net-api-demos\ElectronNET-API-Demos\bin\Release\netcoreapp3.1\win-x64\ElectronNET-API-Demos.dll
  ElectronNET-API-Demos -> C:\GIT\electron.net-api-demos\ElectronNET-API-Demos\bin\Release\netcoreapp3.1\win-x64\ElectronNET-API-Demos.Views.dll
  ElectronNET-API-Demos -> C:\GIT\electron.net-api-demos\obj\desktop\win\bin\
C:\GIT\electron.net-api-demos>
Start npm install...
Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\GIT\electron.net-api-demos\obj\desktop\win>npm install --production
npm WARN deprecated tslint@6.1.2: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN ws@7.3.0 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.3.0 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
added 66 packages from 102 contributors and audited 180 packages in 4.035s
found 2 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
C:\GIT\electron.net-api-demos\obj\desktop\win>
ElectronHostHook handling started...
Build Electron Desktop Application...
Executing electron magic in this directory: C:\GIT\electron.net-api-demos\bin\desktop
Create electron-builder configuration file...
Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\GIT\electron.net-api-demos\obj\desktop\win>node build-helper.js electron.manifest.json
C:\GIT\electron.net-api-demos\obj\desktop\win>
Package Electron App for Platform win...
Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\GIT\electron.net-api-demos\obj\desktop\win>npx electron-builder . --config=./bin/electron-builder.json --win --x64 -c.electronVersion=9.0.3
cli.js build
Build
Building:
  --mac, -m, -o, --macos   Build for macOS, accepts target list (see
                           https://goo.gl/5uHuzj).                       [array]
  --linux, -l              Build for Linux, accepts target list (see
                           https://goo.gl/4vwQad)                        [array]
  --win, -w, --windows     Build for Windows, accepts target list (see
                           https://goo.gl/jYsTEJ)                        [array]
  --x64                    Build for x64                               [boolean]
  --ia32                   Build for ia32                              [boolean]
  --armv7l                 Build for armv7l                            [boolean]
  --arm64                  Build for arm64                             [boolean]
  --dir                    Build unpacked dir. Useful to test.         [boolean]
  --prepackaged, --pd      The path to prepackaged app (to pack in a
                           distributable format)
  --projectDir, --project  The path to project directory. Defaults to current
                           working directory.
  --config, -c             The path to an electron-builder config. Defaults to
                           `electron-builder.yml` (or `json`, or `json5`), see
                           https://goo.gl/YFRJOM
Publishing:
  --publish, -p  Publish artifacts, see https://goo.gl/tSFycD
                [choices: "onTag", "onTagOrDraft", "always", "never", undefined]
Other:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]
Examples:
  electron-builder -mwl                     build for macOS, Windows and Linux
  electron-builder --linux deb tar.xz       build deb and tar.xz for Linux
  electron-builder --win --ia32             build for Windows ia32
  electron-builder                          set package.json property `foo` to
  -c.extraMetadata.foo=bar                  `bar`
  electron-builder                          configure unicode options for NSIS
  --config.nsis.unicode=false
Unknown argument: .
C:\GIT\electron.net-api-demos\obj\desktop\win>
... done
Originally created by @HaydnDias on GitHub (Jul 2, 2020). 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**: 9.31.1 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> Node.js version: 12.18.2 (upgraded from 12.13.1 when the issue started) <!-- What target are you building for? --> * **Target**: win <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> When running `electronize build /target win`, the build errors out with: `Unknown argument: .` This started today after upgrading the dotnet electronnet.cli tool from 5.30.1 -> 9.31.1, I was running it most of the day doing builds and then suddenly with the same commands and without code changes, started getting this issue. I uninstalled and reinstalled, and did a clean setup on a new windows install with the same versions I had previously running and got the same issue. Running the command `npx electron-builder --config=./bin/electron-builder.json --win --x64 -c.electronVersion=9.0.3` (notice the period is removed), results in it working correctly. This happens on our code base on multiple machines (including clean installs) and it happened on your [https://github.comElectronNET/electron.net-api-demos](ElectronNET/electron.net-api-demos) too. ``` C:\GIT\electron.net-api-demos>electronize build /target win Build Electron Application... Build ASP.NET Core App for win-x64... Executing dotnet publish in this directory: C:\GIT\electron.net-api-demos\obj\desktop\win Build ASP.NET Core App for win-x64 under Release-Configuration... Microsoft Windows [Version 10.0.18362.657] (c) 2019 Microsoft Corporation. All rights reserved. C:\GIT\electron.net-api-demos>dotnet publish -r win-x64 -c "Release" --output "C:\GIT\electron.net-api-demos\obj\desktop\win\bin" /p:PublishReadyToRun=true --self-contained Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Determining projects to restore... Restored C:\GIT\electron.net-api-demos\ElectronNET-API-Demos\ElectronNET-API-Demos.csproj (in 1.59 sec). ElectronNET-API-Demos -> C:\GIT\electron.net-api-demos\ElectronNET-API-Demos\bin\Release\netcoreapp3.1\win-x64\ElectronNET-API-Demos.dll ElectronNET-API-Demos -> C:\GIT\electron.net-api-demos\ElectronNET-API-Demos\bin\Release\netcoreapp3.1\win-x64\ElectronNET-API-Demos.Views.dll ElectronNET-API-Demos -> C:\GIT\electron.net-api-demos\obj\desktop\win\bin\ C:\GIT\electron.net-api-demos> Start npm install... Microsoft Windows [Version 10.0.18362.657] (c) 2019 Microsoft Corporation. All rights reserved. C:\GIT\electron.net-api-demos\obj\desktop\win>npm install --production npm WARN deprecated tslint@6.1.2: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information. npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN ws@7.3.0 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself. npm WARN ws@7.3.0 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself. added 66 packages from 102 contributors and audited 180 packages in 4.035s found 2 low severity vulnerabilities run `npm audit fix` to fix them, or `npm audit` for details C:\GIT\electron.net-api-demos\obj\desktop\win> ElectronHostHook handling started... Build Electron Desktop Application... Executing electron magic in this directory: C:\GIT\electron.net-api-demos\bin\desktop Create electron-builder configuration file... Microsoft Windows [Version 10.0.18362.657] (c) 2019 Microsoft Corporation. All rights reserved. C:\GIT\electron.net-api-demos\obj\desktop\win>node build-helper.js electron.manifest.json C:\GIT\electron.net-api-demos\obj\desktop\win> Package Electron App for Platform win... Microsoft Windows [Version 10.0.18362.657] (c) 2019 Microsoft Corporation. All rights reserved. C:\GIT\electron.net-api-demos\obj\desktop\win>npx electron-builder . --config=./bin/electron-builder.json --win --x64 -c.electronVersion=9.0.3 cli.js build Build Building: --mac, -m, -o, --macos Build for macOS, accepts target list (see https://goo.gl/5uHuzj). [array] --linux, -l Build for Linux, accepts target list (see https://goo.gl/4vwQad) [array] --win, -w, --windows Build for Windows, accepts target list (see https://goo.gl/jYsTEJ) [array] --x64 Build for x64 [boolean] --ia32 Build for ia32 [boolean] --armv7l Build for armv7l [boolean] --arm64 Build for arm64 [boolean] --dir Build unpacked dir. Useful to test. [boolean] --prepackaged, --pd The path to prepackaged app (to pack in a distributable format) --projectDir, --project The path to project directory. Defaults to current working directory. --config, -c The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`), see https://goo.gl/YFRJOM Publishing: --publish, -p Publish artifacts, see https://goo.gl/tSFycD [choices: "onTag", "onTagOrDraft", "always", "never", undefined] Other: --help Show help [boolean] --version Show version number [boolean] Examples: electron-builder -mwl build for macOS, Windows and Linux electron-builder --linux deb tar.xz build deb and tar.xz for Linux electron-builder --win --ia32 build for Windows ia32 electron-builder set package.json property `foo` to -c.extraMetadata.foo=bar `bar` electron-builder configure unicode options for NSIS --config.nsis.unicode=false Unknown argument: . C:\GIT\electron.net-api-demos\obj\desktop\win> ... done ```
claunia added the bug label 2026-01-29 16:41:50 +00:00
Author
Owner

@xcs-katsuki commented on GitHub (Jul 3, 2020):

Hi.

I have the same problem.

I ran the following command after electronize build command.
npx electron-builder --config=./bin/electron-builder.json --win --x64 -c.electronVersion=9.0.3

Because error said the period is unknown, I erased the period that at after 'electron-builder'.

@xcs-katsuki commented on GitHub (Jul 3, 2020): Hi. I have the same problem. I ran the following command after electronize build command. `npx electron-builder --config=./bin/electron-builder.json --win --x64 -c.electronVersion=9.0.3` Because error said the period is unknown, I erased the period that at after 'electron-builder'.
Author
Owner

@puddleme commented on GitHub (Jul 3, 2020):

Hi,

I am having this issue aswell.

Running electronize build /target win , I am getting Error: Unknown argument: .

I've tried on my dev machine and on a fresh machine that hasn't worked with Electron before. Also tried changing electron cli, node versions and building a branch that worked in the morning yesterday. Each time I get Error: Unknown argument: .

@puddleme commented on GitHub (Jul 3, 2020): Hi, I am having this issue aswell. Running `electronize build /target win `, I am getting `Error: Unknown argument: .` I've tried on my dev machine and on a fresh machine that hasn't worked with Electron before. Also tried changing electron cli, node versions and building a branch that worked in the morning yesterday. Each time I get `Error: Unknown argument: .`
Author
Owner

@lucasferla7 commented on GitHub (Jul 3, 2020):

Hello,

I also have this problem.

Versions:

  • Net Core: 2.2
  • ElectronNet: 5.22.14
  • ElectronNet.CLI: 5.55.14
  • Node: 12.18.2
@lucasferla7 commented on GitHub (Jul 3, 2020): Hello, I also have this problem. Versions: - Net Core: 2.2 - ElectronNet: 5.22.14 - ElectronNet.CLI: 5.55.14 - Node: 12.18.2
Author
Owner

@rbaker26 commented on GitHub (Jul 4, 2020):

Cannot Build on Windows or Linux

Same problem, but I cannot build on Windows (CMD or Terminal) or Linux (WSL2 -HyperV)
I have attached my Makefile and the script file of it running on Ubuntu 18.04 (WSL2-HyperV VM)
In this makefile, I tried to build all the targets (win, linux, osx).
This Makefile has worked for me previously and has made viable builds for Windows and Linux.

All of my codebase is running .NET Core 3.1.

I had to add .txt to my Makefile and scriptfile to attach it to this comment.
Makefile .txt
typescript.txt

Here is a screenshot of some output from the build.
It is this section that I have never seen before.
image

WSL2 Info:

C:\>wsl --list -v
  NAME            STATE           VERSION
* Ubuntu-18.04    Running         2

Ubuntu WSL2 Info:

rbaker@DESKTOP-EUK8SOJ:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:        18.04
Codename:       bionic

System Info:

OS Name	                Microsoft Windows 10 Home
Version	                10.0.19041 Build 19041
Processor	        Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz, 2801 Mhz, 4 Core(s), 8 Logical Processor(s)
BIOS Version/Date	American Megatrends Inc. GL703VM.314, 4/29/2019
@rbaker26 commented on GitHub (Jul 4, 2020): # Cannot Build on Windows or Linux Same problem, but I cannot build on **Windows** (CMD or Terminal) or **Linux** (WSL2 -HyperV) I have attached my Makefile and the script file of it running on Ubuntu 18.04 (WSL2-HyperV VM) In this makefile, I tried to **build all the targets** (win, linux, osx). This Makefile has worked for me previously and has made viable builds for Windows and Linux. **All of my codebase is running .NET Core 3.1.** I had to add .txt to my Makefile and scriptfile to attach it to this comment. [Makefile .txt](https://github.com/ElectronNET/Electron.NET/files/4872105/Makefile.txt) [typescript.txt](https://github.com/ElectronNET/Electron.NET/files/4872121/typescript.txt) Here is a screenshot of some output from the build. It is this section that I have never seen before. ![image](https://user-images.githubusercontent.com/31376573/86505095-92352080-bd75-11ea-8a02-618c1ec3babf.png) WSL2 Info: ```cmd C:\>wsl --list -v NAME STATE VERSION * Ubuntu-18.04 Running 2 ``` Ubuntu WSL2 Info: ```bash rbaker@DESKTOP-EUK8SOJ:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.4 LTS Release: 18.04 Codename: bionic ``` System Info: ``` OS Name Microsoft Windows 10 Home Version 10.0.19041 Build 19041 Processor Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz, 2801 Mhz, 4 Core(s), 8 Logical Processor(s) BIOS Version/Date American Megatrends Inc. GL703VM.314, 4/29/2019 ```
Author
Owner

@rbaker26 commented on GitHub (Jul 4, 2020):

@GregorBiswanger
@HaydnDias
I summited a PR to fix this issue.
See PR #443

@rbaker26 commented on GitHub (Jul 4, 2020): @GregorBiswanger @HaydnDias I summited a PR to fix this issue. See PR #443
Author
Owner

@zenith6495 commented on GitHub (Jul 4, 2020):

I've noticed this issue is caused by electron-builder, as electronize build runs npm install electron-builder latest v22.7.0 which does not accept "." in the command thus causing the issue. If you try to manually install electron-builder v21 or v20 it will build without issue.

Alternatively, author should remove the "." from the command as well. I don't know what's the purpose of including that "." in the command, can any experienced pros mind sharing? is the "." for Mac or Linux?

@zenith6495 commented on GitHub (Jul 4, 2020): I've noticed this issue is caused by electron-builder, as electronize build runs npm install electron-builder latest v22.7.0 which does not accept "." in the command thus causing the issue. If you try to manually install electron-builder v21 or v20 it will build without issue. Alternatively, author should remove the "." from the command as well. I don't know what's the purpose of including that "." in the command, can any experienced pros mind sharing? is the "." for Mac or Linux?
Author
Owner

@jadhavrani123 commented on GitHub (Jul 4, 2020):

I am also facing same problem of unknown argument . in npx electron builder command .Please give some solution.

@jadhavrani123 commented on GitHub (Jul 4, 2020): I am also facing same problem of unknown argument . in npx electron builder command .Please give some solution.
Author
Owner

@rbaker26 commented on GitHub (Jul 4, 2020):

@zenith6495 @jadhavrani123
I submitted a PR to fix this issue already.
The Gegor, the repo admin, has added it to milestone 9.31.2, so it should work itself out once the milestone gets published.

@rbaker26 commented on GitHub (Jul 4, 2020): @zenith6495 @jadhavrani123 I submitted a PR to fix this issue already. The Gegor, the repo admin, has added it to milestone 9.31.2, so it should work itself out once the milestone gets published.
Author
Owner

@GregorBiswanger commented on GitHub (Jul 4, 2020):

Hello Community, It is an electron builder problem that has a parameter removed. We got a PR with a solution. I think on Monday version 9.31.2 should be released as soon as possible. Big thanks to @rbaker26 for the PR...

@GregorBiswanger commented on GitHub (Jul 4, 2020): Hello Community, It is an electron builder problem that has a parameter removed. We got a PR with a solution. I think on Monday version 9.31.2 should be released as soon as possible. Big thanks to @rbaker26 for the PR...
Author
Owner

@HaydnDias commented on GitHub (Jul 4, 2020):

@GregorBiswanger Thank you for the quick update, I thought removing the . was going to be the fix but wasn't fully sure why it was there to begin with, thanks again!

@HaydnDias commented on GitHub (Jul 4, 2020): @GregorBiswanger Thank you for the quick update, I thought removing the . was going to be the fix but wasn't fully sure why it was there to begin with, thanks again!
Author
Owner

@Altamiraozan commented on GitHub (Jul 9, 2020):

is this solved for latest version? (.net core 3.0)

@Altamiraozan commented on GitHub (Jul 9, 2020): is this solved for latest version? (.net core 3.0)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#522