19 October 2019

DevOps Error: Process 'msbuild.exe' exited with code '1'.

If the build pipeline fails directly after it has startet with the build error: Process 'msbuild.exe' exited with code '1'. This can have multiple reasons. To do the build it requires the AXModulesBuild.proj
So first of all check the folder in the error message. If you are using another folder, different branch,... go to the build pipeline and check the projects path:




Error Message:

Starting: Build the solution
==============================================================================
Task : MSBuild
Description : Build with MSBuild
Version : 1.151.1
Author : Microsoft Corporation
==============================================================================
"C:\Program Files (x86)\MSBuild\14.0\bin\amd64\msbuild.exe" "C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj" /nologo /nr:false /t:"Clean" /dl:CentralLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=a80b24ca-30a5-4568-b3f7-2c165ff76fec|SolutionDir=C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\DEV"*ForwardingLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:OutputPath="C:\DynamicsSDK\VSOAgent\_work\1\Bin" /p:LogPath="C:\DynamicsSDK\VSOAgent\_work\1\Logs" /p:platform="Any CPU" /p:configuration="Release" /p:_MSDeployUserAgent="VSTS_5a5acfcb-fe8b-4039-99f2-cadc61c1646d_build_21_0"
MSBUILD : error MSB1009: Project file does not exist.
Switch: C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj
##[error]Process 'msbuild.exe' exited with code '1'.
"C:\Program Files (x86)\MSBuild\14.0\bin\amd64\msbuild.exe" "C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj" /nologo /nr:false /dl:CentralLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=d2221e15-48e9-44a2-a294-5c21c60dcaa6|SolutionDir=C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV"*ForwardingLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:OutputPath="C:\DynamicsSDK\VSOAgent\_work\1\Bin" /p:LogPath="C:\DynamicsSDK\VSOAgent\_work\1\Logs" /p:platform="Any CPU" /p:configuration="Release" /p:_MSDeployUserAgent="VSTS_5a5acfcb-fe8b-4039-99f2-cadc61c1646d_build_21_0"
MSBUILD : error MSB1009: Project file does not exist.
Switch: C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj
##[error]Process 'msbuild.exe' exited with code '1'.
Finishing: Build the solution

09 October 2019

Unblock multiple files with PowerShell

Because I always forget to unblock files before I extract the zip files from Microsoft: Here is a PowerShell command to do it after the zip is extracted and a whole bunch of files are blocked

dir -Path .\FinanceAndOperations_10.0.136.10007_Application\ -Recurse | Unblock-File

this is definitely faster then deleting all the files and extracting again.