locked
MSBuild error: The command exited with code 255 due to post build event command RRS feed

  • Question

  • Hi All,
    I am working on Winforms projects. I am facing a build issue (in release mode) on Jenkins server which is running on a remote machine.
    Below is the error on Jenkins log:
    "D:\Nightly\DataStore.NET\Client\mainline\DataStoreClient.sln" (Rebuild target) (1) -> "D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\Outlook2010AddIn.csproj" (Rebuild target) (58) -> C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: The command "..............\Utilities\DeployDataLogicsPdfLibrary\bin\DeployDataLogicsPdfLibrary.exe "D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn..............\ThirdPartyControls\DataLogics\APDFL15.0.4\DLE" D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\bin\ [D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\Outlook2010AddIn.csproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: rmdir /s /q "D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\bin\Aspose.Cells.dll" [D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\Outlook2010AddIn.csproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn........\Utilities\VstoManifestGenerator\VstoManifestGenerator.exe D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\bin\Hitec.DataStore.Office.AddIn.Outlook.dll Release" exited with code 255. [D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\Outlook2010AddIn.csproj]
    Please see the post build event command below:


    I am working on Winforms projects. I am facing a build issue (in release mode) on Jenkins server which is running on a remote machine.

    Below is the error on Jenkins log:

    "D:\Nightly\DataStore.NET\Client\mainline\DataStoreClient.sln" (Rebuild target) (1) -> "D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\Outlook2010AddIn.csproj" (Rebuild target) (58) -> C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: The command "..............\Utilities\DeployDataLogicsPdfLibrary\bin\DeployDataLogicsPdfLibrary.exe "D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn..............\ThirdPartyControls\DataLogics\APDFL15.0.4\DLE" D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\bin\ [D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\Outlook2010AddIn.csproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: rmdir /s /q "D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\bin\Aspose.Cells.dll" [D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\Outlook2010AddIn.csproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn........\Utilities\VstoManifestGenerator\VstoManifestGenerator.exe D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\bin\Hitec.DataStore.Office.AddIn.Outlook.dll Release" exited with code 255. [D:\Nightly\DataStore.NET\Client\mainline\Applications\AddIns\Office\Outlook2010AddIn\Outlook2010AddIn.csproj]

    Please see the post build event command below:

    ..\..\..\..\..\..\..\Utilities\DeployDataLogicsPdfLibrary\bin\DeployDataLogicsPdfLibrary.exe "$(ProjectDir)..\..\..\..\..\..\..\ThirdPartyControls\DataLogics\APDFL15.0.4\DLE" $(TargetDir)
    rmdir /s /q "$(TargetDir)Aspose.Cells.dll"
    $(ProjectDir)..\..\..\..\Utilities\VstoManifestGenerator\VstoManifestGenerator.exe $(TargetPath) $(ConfigurationName)

    I don't have this issue on the local dev machine. So, I assume, I am missing something on the build machine or something I am missing on post build event command, but cannot figure out what.

    Anyone know why this happened?

    Thank You :)

    Wednesday, September 9, 2020 3:21 PM

All replies

  • Could very well be a permission issue.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Proposed as answer by CoolDadTx Thursday, September 10, 2020 2:30 PM
    Wednesday, September 9, 2020 3:33 PM
  • Hi Ankit Raman,

    Thank you for posting here.

    This seems to be not a problem in the c# code, but a problem with the Jenkins server, so it is best to ask for help through the channels they provide.

    Professional Sites

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, September 10, 2020 3:00 AM
  • As Karen mentioned the DeployDataLogicPdfLibrary.exe is failing. Given the name it sounds like it is trying to deploy files somewhere and that naturally won't work on a build server. You will need to modify your build such that it does not try to "deploy" files when running on the build server. This is a very common problem. Build servers just build the code. Deployment servers are responsible for deploying. When running locally we tend to do both together.

    My personal recommendation is to use configurations. For example most devs build in Debug mode so have your post build event that runs the deploy only run when doing Debug builds (hence locally). The build server is probably doing a Release build so the post build event won't run in release mode. Problem is solved. To make post build events conditional (because they are not per-configuration) you'll have to add a macro into the script. The VS IDE will help with this.

    If you need to be able to do Debug and Release builds either locally or on the build server then you probably aren't doing it right but if you have that need then you cannot rely solely on configuration. In that case you can either create duplicate configurations that specific for the build server (e.g. Debug => Debug on Server, Release => Release on Server). Then you adjust your build server to use the new configurations instead.

    If that is not possible for some reason then the last resort is to add a custom build property. My personal recommendation is to use a negative property (e.g. DoNotDeploy). Update your build event to only run if this is not set/true. This is normally not set so it will try to deploy. However on your build server when calling MSBuild add the property with the the value set to true. Then it'll skip the deployment.


    Michael Taylor http://www.michaeltaylorp3.net

    Thursday, September 10, 2020 2:36 PM