I have ASP.NET Core 2.0 applications that is hosted in IIS on windows 2012RC2 machine. We use Jenkins for CI. The following commands will be executed on the Build Server where Jenkins is installed. The user that Jenkins is running under has full domain-admin access.
To build and deploy the application I wanted to make use of publish profile option as mentioned here.
So I created publish profile and executed the following command on the build server
dotnet publish D:\Jenkins\MyProject\workspace\MyApplication\Src\Api\Api.csproj /p:PublishProfile=development.pubxml
it build the project successfully but during the deployment I got error:
MSDEPLOY : error Code: ERROR_DESTINATION_NOT_REACHABLE [D:\Jenkins\MyProject \workspace\ MyApplication\Src\Api\Api.csproj]
MSDEPLOY : error : Unable to connect to the remote server [D:\Jenkins\ MyProject\workspace\ MyApplication\Src\Api\Api.csproj]
MSDEPLOY : error : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond XXXXXXXXXX:8172
MSDEPLOY : error count: 1. [D:\Jenkins\MyProject\workspace\MyApplication\Src\Api\Api.csproj]
Based on the error it looks like MSDEPLOY is trying to use IIS Web Management Service
, I do not have Web Management Service
installed on the target server. ( and I do not want to). Instead, I already have Web Deployment Agent Service
installed on the target web server.
(Note: I have other classic ASP.NET Web applications and Jenkins is able deploy these projects to the same target server using MSBuild and Web Deployment Agent Service so I am sure the connection from the build server to target web server is there and working)
I am not sure why MSDEPLOY here is trying to connect to Web Management Service
instead of using Web Deployment Agent Service
. Here is development.pubxml
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<TargetFramework>netcoreapp2.0</TargetFramework>
<ProjectGuid>ec75aa7b-c5ca-4d08-a80e-0d70c604f85c</ProjectGuid>
<MSDeployServiceURL>target machine name</MSDeployServiceURL>
<DeployIisAppPath>MyIISApplicationPath</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName />
<_SavePWD>False</_SavePWD>
<AuthType>NTLM</AuthType>
</PropertyGroup>
</Project>