1

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>
LP13
  • 30,567
  • 53
  • 217
  • 400
  • 2
    I'm guessing it has something to do with `WMSVC`? Have you tried changing `WMSVC` to `RemoteAgent`? – Simply Ged May 18 '18 at 08:27
  • that worked. So changing `WMVSC` to `RemoteAgent` worked. However, i have 3 appsettings in applicaiton, `appsettings.json` , `appsettings.development.json` and `appsettings.production.json`..it deploys all. Is there anyway to tell web deployment to deploy environment specific appsetting file – LP13 May 18 '18 at 15:02

0 Answers0