Web site fails to deploy - asp.net

I have created a new ASP.NET5 web site, using VS2015 CE, and I can't get it to deploy to an IIS7.5 server.
I can deploy older projects to this server.
When I use the Publish Web wizard, the Connection tab is correctly configured (Validate Connection shows success). Pressing "Start Preview" on the Preview Tab shows the correct list of files to be sent to the server.
This suggests to me that VS can communicate successfully with WebDeploy on the server.
When I press Publish, I get:
Error Code: ERROR_DESTINATION_NOT_REACHABLE
More Information: Could not connect to the remote computer (blah blah blah)
/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE
Error: Unable to connect to the remote server
I have read https://docs.asp.net/en/latest/publishing/iis-with-msdeploy.html and followed all the instructions.

Deploy the package manually using MSDeploy.exe with the -verbose flag to try to get more details about the error.
>"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package=WebApplication7.zip -dest:manifest=WebApplication7.DestManifest.xml
There is a section at the bottom of the following post with full instructions on deploying a package manually.
The Anatomy of a WebDeploy Package

Related

ERROR_DESTINATION_NOT_REACHABLE: Web deployment task failed

When I try to publish code using Web Deploy method I am getting the following error
ERROR_DESTINATION_NOT_REACHABLE: Web deployment task failed. (Could not connect to the remote computer ("xxxxx.xxxxxxx.xxx.xxxx"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started
On my server,I have web deployer 3.5 install and web management service is also running.
There is no firewall issue also.
I have restarted the web management service still no luck
If you want to publish a site on a remote server you could follow the below steps:
Go to the Start menu and right-click the cmd.exe and then select Run as Administrator.
Enter the following in the command prompt:
winrm quickconfig
winrm set winrm/config/client #{TrustedHosts="*"}
On the target server, open a command prompt as an Administrator and
enter the following:
winrm quickconfig
winrm set winrm/config/client #{TrustedHosts="IP_ADDRESS"}
where IP address is the IP address of your remote server.
make sure you installed Management service.
-after doing all the above things open iis.
carete site with a blank folder at the destination (remote server)
go back to the server from which you want to publish a site and select Publish.
On the Publish page, click the icon labeled IIS, FTP, etc.
In the Publish Method list box, select Web Deploy:
or if you want to publish as an application under any site:
no need to create site at the destination server.
enter your site name in the site name and enter your application name after /.
Regards,
Jalpa

Is it possible to publish an asp.net 2012 web application to azure?

I tried to publish a web app from asp.net 2012 to azure but it gives an error "Error 1 Package/Publish task Microsoft.Web.Publishing.Tasks.CreateProviderList failed to load Web Deploy assemblies. Microsoft Web Deploy is not correctly installed on this machine. Microsoft Web Deploy v3 or higher is recommended. "
I tried installing it but the same error exists.
Sure, Azure App Services can be used like an IIS Container.
If Visual Studio fails to publish, you could upload your application via FTP or by using auto-deploy from a GIT repository.
Once the application is deployed, Azure will read the Web.config file, so you can set up your application environment there.
You have installed Microsoft Web Deploy v3, you can try to run MSDeploy.exe command directly to deploy a web application (web deployment package) to Azure app service web app. The following command works fine for me, please refer to it.
MSDeploy.exe
-source:package="C:\testapp\WebApplication1.zip"
-dest:auto,
computerName="https://{my_app_name}.scm.azurewebsites.net/MSDeploy.axd?site={my_app_name}",
username="{user_name}",
password="{password}",
authtype="Basic",
includeAcls="False"
-verb:sync
-disableLink:AppPoolExtension
-disableLink:ContentExtension
-disableLink:CertificateExtension
-setParamFile:"C:\testapp\WebApplication1.SetParameters.xml"
-allowUntrusted
Note:
You can get username and password from publish profile on
Azure portal;
For more information about deploying a web application using MSDeploy.exe, you can refer to this article.

Remote Web Deploy not working

I have developed several ASP.NET 4.5 applications and I want to publish them to a remote computer running IIS 8, using Web Deploy.
I created two sites in IIS8, Site1 and Site2. I created a single IIS User and I gave permission to access both sites to this user.
I can publish the first site via Web Deploy, but I cannot publish the second site.
When I try to publish the second site, I get this error in Visual Studio
2>Start Web Deploy Publish the Application/package to https://27.147.144.98:8172/msdeploy.axd?site=NSU ...
2>Adding ACL's for path (NSU)
2>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4255,5): Error : Web deployment task failed. ((6/30/2015 12:36:37 PM) An error occurred when the request was processed on the remote computer.)
2>
2>(6/30/2015 12:36:37 PM) An error occurred when the request was processed on the remote computer.
2>The server experienced an issue processing the request. Contact the server administrator for more information.
2>Publish failed to deploy.
The first site is published correctly always. The problems occurs only for the second site.
I had this error but also had Fiddler2 running which seemed like it was interfering with the deployment. When I closed it, things worked again. Make sure you test the connection beforehand.

MSDeploy.exe can connect as Administrator, but not any other Windows account

I'm integrating MSDeploy into my build process, and having problems authenticating. The following command works fine:
msdeploy -verb:sync -source:appHostConfig="KitchenPC",computerName=192.168.0.3,userName=Administrator,password=secret -dest:package=c:\DeployTest\KPC.zip
However, this does NOT work:
msdeploy -verb:sync -source:appHostConfig="KitchenPC",computerName=192.168.0.3,userName=kpcpublish,password=secret -dest:package=c:\DeployTest\KPC.zip
And yields the error:
Error Code: ERROR_USER_NOT_ADMIN
More Information: Connected to '192.168.0.11' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administ
rator on '192.168.0.11'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error: The remote server returned an error: (401) Unauthorized.
Error count: 1.
I've followed the instructions in the link above, and any other docs I could find, which pretty much all say the same thing:
I created an account called kpcpublish
I added this account to a group called MSDepSvcUsers - Heck, I even added the account to Administrators
I right clicked on the site and selected Deploy->Configure Web Deploy Publishing and added kpcpublish to the list. It says the following:
.
Publish enabled for 'SERVER\kpcpublish' Granted 'SERVER\kpcpublish'
full control on 'C:\Website' Successfully created settings file
'C:\Users\Administrator\Desktop\SERVER_kpcpublish_KitchenPC.PublishSettings'
There must be some step I'm missing, but I just can't figure out what could be.
UPDATE:
Using the full HTTP path for the computerName property, I get the error:
Error Code: ERROR_DESTINATION_NOT_REACHABLE More Information: Could
not connect to the remote computer ("192.168.0.3"). On the remote
computer, make sure that Web Deploy is installed and that the required
process ("Web Management Service") is started. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DES
TINATION_NOT_REACHABLE. Error: Unable to connect to the remote server
Error: A connection attempt failed because the connected party did not
properly respond after a period of time, or established connection fa
iled because connected host has failed to respond 192.168.0.3:8192
Error count: 1.
I've checked and the Web Management Service is indeed running.
Another Update:
I've completely paved the system and set it up again from scratch. I've done nothing out of the ordinary, just installed the IIS role and made sure to check "Management Service" under Management Tools, which is required for WMSVC to run. I then installed Web PI, and installed "Recommended Configuration for Hosting Providers", which will install Web Deploy 3.0. However, I did notice there was an error while installing this (I believe I got this error the last time as well). It looks like:
I've also attached the log files here.
I then tried to install Web Deploy 3.0 manually, however it says it's already installed. Next, I downloaded the MSI directly from http://www.iis.net/download/webdeploy and ran it in "Repair" mode. That seems to have worked. I also noticed that the WMSVC service is up and running. So this looks good.
Still, MSDeploy will not connect. I thought it might be some sort of firewall issue, so I ran it locally. I've tried using both HTTPS and HTTP to connect. HTTPS gives me an error, HTTP just times out after 2-3 minutes.
HTTPS:
msdeploy -verb:sync -source:appHostConfig="Default Web Site",computerName=https://STAGING:8172/msdeploy.axd,userName=Administrator,password=Khorf123 -dest:package=c:\DeleteMe.zip
Info: Using ID 'f3a54096-adc4-4f54-9e4f-ad8fde12edb6' for connections to the remote server.
Error Code: ERROR_CERTIFICATE_VALIDATION_FAILED
More Information: Connected to the remote computer ("staging") using the specified process ("Web Management Service"), but could not verify the server's certifi
cate. If you trust the server, connect again and allow untrusted certificates.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.
Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Error: The remote certificate is invalid according to the validation procedure.
Error count: 1.
HTTP:
msdeploy -verb:sync -source:appHostConfig="Default Web Site",computerName=http://STAGING:8172/msdeploy.axd,userName=Administrator,password=Khorf123 -dest:package=c:\DeleteMe.zip
Info: Using ID 'ebee66f0-08e5-4d9d-98ea-0c2e59784895' for connections to the remote server.
Error: Could not complete the request to remote agent URL 'http://staging:8172/msdeploy.axd'.
Error: The operation has timed out
Error count: 1.
(Updated 2016-03-07 - NOTE: non-Administrator deployments also require ?site=IIS_SITE_NAME after msdeploy.axd, otherwise the connection is treated as global and requires Administrator access)
Not sure how missed this originally, but your problem is the computerName parameter. Non-administrator deployments are only supported when using WMSVC, for which you need to specify the full URL.
Try the following
msdeploy -verb:sync ^
-source:appHostConfig="KitchenPC",computerName=https://192.168.0.3:8172/MsDeploy.axd,userName=kpcpublish,password=secret,authType=Basic ^
-dest:package=c:\DeployTest\KPC.zip
From the docs:
The computer name will be translated to the default Web Deploy URL. For example, computerName=Server1 will become http://Server1/MsDeployAgentService. If the remote service is running with a custom port or URL, you must specify the full URL
And from the install instructions:
The MSI will not install the Web Management Service handler component if the Web Management Service is not installed; the handler component is necessary for non-administrator deployments
(I couldn't find a more explicit canonical source that describes WMSVC as a requirement for non-admin deployments)
Figured It Out!
So, it seems that (at least by default), WMSVC only listens on HTTPS, and HTTP will just time out. However, since my certificate was self-signed, I had to use the -allowUntrusted command line option.
That was almost enough. I also had to specify authType=Basic like Richard originally suggested. So, to put it all together, this is the MSDeploy command line that will actually work:
msdeploy -verb:sync -source:appHostConfig="Default Web Site",computerName=https://192.168.0.3:8172/msdeploy.axd,authType=Basic,userName=Publish,password=secret -dest:package=c:\DeployTest\KPC.zip -allowUntrusted
After configuring Web Deploy my server as follows. I continued to get HTTP 404 connection failures. In may what worked for me was the following additional efforts...
Uninstall all previous version of Web Deploy that existed. I was not even aware they existed; however, previous versions appear to conflict with completing a connection to the latest Web Deploy service. Newer version don't uninstall their predecessors. In the last part, I was getting HTTP 401.7 - File Extension Denied.
For good measure, performed a repair of the current version of Web Deploy, currently Microsoft Web Deploy 3.6
For good measure, recreate and import my Visual Studio 2013 deployment profile...
recreate the publish settings file using the Configure Web Deploy Publishing dialogue available from the Deploy context menu option of the target website in IIS Manager's Connections panel. (Note, the publish settings file will be recreated when you press Setup as the file whose full path is specified in the dialogue entry, Specify a location to save the publish settings file)
Copy or otherwise make the publish settings file available to Visual Studio and selecting Publish from your project's context menu, create a Visual Studio publish profile by importing the publish settings file.
Try restarting the wmsvc service on the target machine
As alluded to above, make sure that you are connecting over HTTPS. If you are attempting to connect as Admin, but not using SSL, you get the following error:
Error Code: ERROR_USER_NOT_ADMIN
More Information: Connected to 'host' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'host'.
(Where 'host' is your server name)
For me the problem was that my password expired... I've noticed it when loging out and then tried to login back trhough remote desktop.

TFS deploy error destination not reachable

We have 1 new DEV and 1 new QA server that I am configuring for automated deploys. I got the DEV deploys working. My problem is that the deploy to QA is giving me the below error.
Our build server contains the controller and drop folder. The error occurs when the Invoke deploy command is issued. I have ensured that the Web Management service is running on the web servers.
What could be causing the follow error message?
Error Code: ERROR_DESTINATION_NOT_REACHABLE
More Information: Could not connect to the destination computer ("myWebServer").
On the destination computer, make sure that Web Deploy is installed and that the
required process ("Web Deployment Agent Service") is started.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.
Here is my deploy command:
\\myBuildServer\Builds\MyApp - Deploy to QA\myApp - Deploy to QA_20120827.1\_PublishedWebsites\AppName.UI.Web_Package\Appname.UI.Web.deploy.cmd /M:http://myWebAddress/MsDeployAgentService/ /U:myDomain\tfsUID /P:MyPassword "-setParam:name='IIS Web Application Name',value='MyWebAppName'" /Y
If you're on IIS 7, ensure that WMSvc is installed (add or turn on Windows features) running, that it is configured correctly and enabled in IIS Manager under "Management Service" and that port 8172 is open - try telnet-ing into it.
If IIS 6, install the Web Deploy agent.
For IIS 7 using WMSvc, you should use http://svr:8172/MsDeploy.axd and for MsDepSvc you are already using the right URL (see your /M param).
I've found the whole remote publishing to be a total ballache.
When you install Web Deploy, make sure to select Custom and check all components. This is what solved the issue for me.
Source: Could not reach the Web Deploy endpoint on the specified virtual machine

Resources