Azure DevOps, Scrum, & .NET Software Leadership and Consulting Services

Free course! Predicting the Future, Estimating, and Running Your Projects with Flow Metrics

How to fix “msdeploy.exe failed with return code: 2148734720”


I’m trying to deploy to an Azure AppService using an on-premise build/release agent and Team Foundation Server 2018.  This usually isn’t a problem but this time was difficult.  Part of the problem is that I’m trying to run a TFS Release from an agent that’s installed on Windows Server Core Build 1709.

When I ran the release, I was getting an error that said “msdeploy.exe failed with return code: 2148734720“.

2018-01-09T18:33:42.6976871Z ##[error]Error: C:\agent\_work\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\3.3.16\MSDeploy3.6\msdeploy.exe failed with return code: 2148734720

Initially, I thought there was a problem with the “Deploy Azure App Service” task in TFS/VSTS.  The solution came from a passing comment by brady321 in this stackoverflow thread.  He suggested that this might have something to do with a requirement for .NET Framework 3.5 being installed on the machine.

Turns out he was right.

I logged in on the build server and ran the following powershell command to see if .NET 3.5 Framework was installed.

Get-WindowsFeature NET-Framework-Features

The answer was no so I installed .NET 3.5 Framework by running

Install-WindowsFeature NET-Framework-Features

After that, I re-ran the release the msdeploy worked just fine.

I hope this helps.

-Ben

SUBSCRIBE TO THE BLOG


3 responses to “How to fix “msdeploy.exe failed with return code: 2148734720””

  1. xkarivers Avatar
    xkarivers

    Thanks for sharing. Don’t even want to guess how long I would a have spent trying to figure this out, never would have guessed.

  2. sekhar Avatar
    sekhar

    hub controller process exited prematurely with exit code 2148734720

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.