2012-06-05 54 views
7

我正在嘗試網絡部署。MsDeploy失敗webdeploy

因爲我希望能夠重現這一點,我使用的測試系統

Windows 2008的RC,IIS 7.5 +部署包 我配置部署中使用 http://learn.iis.net/page.aspx/516/configure-the-web-deployment-handler/ 啓用跟蹤 http://technet.microsoft.com/en-us/library/ff729439(v=ws.10).aspx

我創建一個新的WCF服務應用程序,(沒有改變)編譯它並試圖部署

我得到以下響應(幾分鐘後)

------ Build started: Project: WcfService1, Configuration: Debug Any CPU ------ 
    WcfService1 -> C:\Development\BrandShield\Services\WcfService1\bin\WcfService1.dll 
------ Publish started: Project: WcfService1, Configuration: Debug Any CPU ------ 
Transformed Web.config using Web.Debug.config into obj\Debug\TransformWebConfig\transformed\Web.config. 
Auto ConnectionString Transformed obj\Debug\TransformWebConfig\transformed\Web.config into obj\Debug\CSAutoParameterize\transformed\Web.config. 
Copying all files to temporary location below for package/publish: 
obj\Debug\Package\PackageTmp. 
Start Web Deploy Publish the Application/package to http://dev1:8172/msdeploy.axd/MSDEPLOYAGENTSERVICE ... 
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Error : Web deployment task failed.(Could not complete the request to remote agent URL 'http://dev1:8172/msdeploy.axd/MSDEPLOYAGENTSERVICE'.) 
This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server. 
Error details: 
Could not complete the request to remote agent URL 'http://dev1:8172/msdeploy.axd/MSDEPLOYAGENTSERVICE'. 
The underlying connection was closed: An unexpected error occurred on a receive. 
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. 
An existing connection was forcibly closed by the remote host 
Publish failed to deploy. 
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ========== 
========== Publish: 0 succeeded, 1 failed, 0 skipped ========== 

並且在dev1服務器端沒有日誌(完全)。

我已經嘗試了許多變化,但這是最簡單,最容易重現的事情。這是失敗的。

有什麼想法?

+0

看看http://mperlstein.blogspot.co.il/2012/ 04 /網絡部署上,iis7.html –

回答

9

我發現了這個問題。

的不是 「http://」 DEV1:8172/msdeploy.axd我用DEV1:8172/msdeploy.axd

這是actaully同爲 「https://開頭」 DEV1:8172/msdeploy。 axd,由於某種原因,這是部署代理偵聽的地方。

從這裏,你會得到一個新的錯誤:

Could not complete the request to remote agent URL 'https://dev1:8172/msdeploy.axd?site=Default web site'. 
The underlying connection was closed: 
Could not establish trust relationship for the SSL/TLS secure channel. 
The remote certificate is invalid according to the validation procedure. 

這是因爲你不具備SSL證書。

在發佈配置窗口中,您需要檢查 「允許不受信任的證書」複選框

和發佈應succceed。好運

0

通過傳遞證書:

步驟1:

System.Net.HttpWebRequest req = (HttpWebRequest)WebRequest.Create(Url); 
ServicePointManager.ServerCertificateValidationCallback = AcceptAllCertifications; 

步驟2:

public Boolean AcceptAllCertifications(Object sender, System.Security.Cryptography.X509Certificates.X509Certificate certification, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors) 
{ 
    return true; 
} 
相關問題