Hanging msbuild Build

I use gitlab for build msi. But one day it stopped working.
The process hangs without errors in random line.

variables:
  PROJECT_NAME: 'NetVideo.NotificationService'
  NUGET_PATH: 'C:\Tools\nuget.exe'
  VERSIONER_PATH: 'C:\Tools\versioner.exe'
  MSBUILD: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe'
  XUNIT: 'C:\Tools\xUnit\xunit.console.exe'
  OUT_PATH: 'C:\Builds\NotificationService'
  SOLUTION_FILE_PATH: 'NotificationService.sln'

stages:
  - start_trigger
  - compile
  #- package

start:
  stage: start_trigger
  when: manual
  allow_failure: false
  script:
    - 'echo PIPELINE_SOURCE=%CI_PIPELINE_SOURCE%'

compile:
  stage: compile
  dependencies:
    - start
  script:
    - '%NUGET_PATH% restore %SOLUTION_FILE_PATH% -NonInteractive'
    - '"%msbuild%" %SOLUTION_FILE_PATH% /t:Build /p:Configuration=Release /maxcpucount /nologo'
    - 'dotnet publish -c Release -r win-x64 --self-contained true NotificationService\NotificationService.csproj /p:PublishProfile=NotificationService\Properties\PublishProfiles\FolderProfile.pubxml -o Publish'
    - 'cd NetVideo.NotificationService.Installer'
    - 'bin\Release\net40\NetVideo.Notification.Installer.exe'
    - 'copy /Y NetVideo.NotificationService.msi %OUT_PATH%'
  cache:
    key: ${CI_COMMIT_SHA}
    policy: push
    paths:
      - NetVideo.NotificationService.Installer\
      - NotificationService\bin\Release\netcoreapp3.1\ClientApp\
  artifacts:
    name: "Installers"
    paths:
      - 'NetVideo.NotificationService.Installer/NetVideo.NotificationService.msi'
    expire_in: 1 week

I ran this in console

I replaced line "%msbuild%" %SOLUTION_FILE_PATH% /t:Build /p:Configuration=Release /maxcpucount /nologo to dotnet build %SOLUTION_FILE_PATH% -c Release -nologo
It works now.

1 Like