Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The following MSDeploy string supplied to the command line results in an error. Can anyone shed any light on this?

"C:\Program Files\IIS\Microsoft Web Deploy\\msdeploy.exe" -source:package='D:\dev\Project\obj\BuildConfiguration\Package\Project.zip' -dest:auto='Website Name',computerName='computername',userName='username',password='password' -verb:sync -enableRule:DoNotDeleteRule -allowUntrusted -debug

Stack trace:

Microsoft.Web.Deployment.DeploymentAgentUnavailableException: Could not complete the request to remote agent URL 'http://computername/MSDEPLOYAGENTSERVICE'.
---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)   
--- End of inner exception stack trace ---    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)    at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)    at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)    --- End of inner exception stack trace ---    at System.Net.HttpWebRequest.GetResponse() at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request)    --- End of inner exception stack trace ---    at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request)    at Microsoft.Web.Deployment.AgentClientProvider.CreateStatusThread(DeploymentSyncContext syncContext)    at Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObject sourceObject, DeploymentSyncContext syncContext)    at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable)    at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)    at MSDeploy.MSDeploy.ExecuteWorker() Error count: 1.
share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Did you installed on 'computername' - msdeploy agent service?

To install it - you must:
1) download package from iis.net
2) install management service (for IIS on DEST server)
3) configure management service (to allow by ip something, note: there is required AT LEAST ONE entry)
4) start management service
5) start agent service
6) try deployment

I'm sure it should work (I've encounter this error when tried to use msdeploy for first time)

share|improve this answer
add comment

I've also seen this 'forcibly disconnected' error message when the certificate used by the management service is invalid for the server.

In my case, I created a standard web server VM, then cloned a sysprepped version of the VM. The management service on the cloned VM's was still displaying a certificate issued by the original VM.

Replacing the bad certificate with a self-signed certificate clears the problem right up.

It took me a few minutes to figure that one out initially...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.