mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
csproj ComputeFilesToPublish section cause "Error occurred during dotnet publish." error on Angular projects #174
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Blind-Striker on GitHub (Jun 7, 2018).
Hi,
First of all, thank you for developing such a project. I trying to use Electron.NET with Visual Studio Angular 5 template. To facilitate publishing process they have put some post publish scripts to csproj file.
As you can see they run some npm commands on
PublishRunWebpack. But if i rundotnet electronize startcommand, , I get the "Error occurred during dotnet publish." error and if i remove this sectiondotnet electronize startruns without an error.I have inspect the source code of ElectronNET.CLI and found which command cause this error.
StartElectronCommand.cs#L54
Its executing
dotnet publish -r win-x64 --output "D:\My\infinity-item\src\InfinityItem\InfinityItem\obj\Host\bin"command in my environment.And if I run this command manually, it works run without an error.
Then i reliazed this command also runs succesfuly with
dotnet electronize start. Because i can see compiled output onD:\My\infinity-item\src\InfinityItem\InfinityItem\obj\Host\binpath.So, the problem may be related to exit codes, even if npm commands are successful, when ProcessHelper.CmdExecute is called.
I temporarily solve my problem with powershell script below
Build command
@Blind-Striker commented on GitHub (Jun 9, 2018):
I made an cake addin for Electron.Net to use in my personel project. Maybe it can be useful for someone else too.
https://github.com/Blind-Striker/Cake.Electron.Net
@GregorBiswanger commented on GitHub (Jul 22, 2018):
Thank you @Blind-Striker
@leidsongermano commented on GitHub (Aug 14, 2018):
I could solved this problem supressing the ng build output. I made these changes on .csproj:
From:
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" /> <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />To:
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod --no-progress" /> <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod --no-progress" Condition=" '$(BuildServerSideRenderer)' == 'true' " />