Web publish on vs2013 not working - help

Discussion in 'FTP' started by Trevor Eland, Mar 13, 2015.

  1. Hi,

    I'm having problems getting my web publish working from vs2013.

    Getting the following error:

    Error 2 Web deployment task failed. (Could not deploy package.
    Unable to connect to target server.

    The connection is validated ok in vs2013 and does depploy some of the files to the server but is falling over some where. Can anyone provide assistance on this?

    My publish xml is:

    <?xml version="1.0" encoding="utf-8"?>
    <!--
    This file is used by the publish/package process of your Web project. You can customize the behavior of this process
    by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
    -->
    <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
    <IncludeSetAclProviderOnDestination>false</IncludeSetAclProviderOnDestination>
    <WebPublishMethod>MSDeploy</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish>http://www.tjeland.com/myapp</SiteUrlToLaunchAfterPublish>
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>True</ExcludeApp_Data>
    <MSDeployServiceURL>https://w18.Winhost.com:8172/MsDeploy.axd</MSDeployServiceURL>
    <DeployIisAppPath>tjeland.com/myapp</DeployIisAppPath>
    <RemoteSitePhysicalPath />
    <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
    <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
    <EnableMSDeployBackup>True</EnableMSDeployBackup>
    <UserName>tjelandc</UserName>
    <_SavePWD>True</_SavePWD>
    <PublishDatabaseSettings>
    <Objects xmlns="">
    <ObjectGroup Name="SchoolContext" Order="1" Enabled="True">
    <Destination Path="Data Source=tcp:s11.Winhost.com;Initial Catalog=DB_81892_contoso;Integrated Security=False;User ID=DB_81892_contoso_user;Password=*****" Name="Data Source=tcp:s11.Winhost.com;Initial Catalog=DB_81892_contoso;User ID=DB_81892_contoso_user;Password=******;Integrated Security=False;" />
    <Object Type="DbCodeFirst">
    <Source Path="DBMigration" DbContext="ContosoUniversity.DAL.SchoolContext, ContosoUniversity.DAL" MigrationConfiguration="ContosoUniversity.DAL.Migrations.Configuration, ContosoUniversity.DAL" Origin="Configuration" />
    </Object>
    </ObjectGroup>
    <ObjectGroup Name="DefaultConnection" Order="2" Enabled="True">
    <Destination Path="Data Source=tcp:s11.Winhost.com;Initial Catalog=DB_81892_contoso;Integrated Security=False;User ID=DB_81892_contoso_user;Password=******" Name="Data Source=tcp:s11.Winhost.com;Initial Catalog=DB_81892_contoso;User ID=DB_81892_contoso_user;Password=******;Integrated Security=False;" />
    <Object Type="DbDacFx">
    <PreSource Path="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-ContosoUniversity.mdf;Initial Catalog=aspnet-ContosoUniversity;Integrated Security=True" includeData="False" />
    <Source Path="$(IntermediateOutputPath)AutoScripts\DefaultConnection_IncrementalSchemaOnly.dacpac" dacpacAction="Deploy" />
    </Object>
    <UpdateFrom Type="Web.Config">
    <Source MatchValue="Data Source=(LocalDb)\v11.0;Integrated Security=SSPI;Initial Catalog=aspnet-ContosoUniversity;AttachDBFilename=|DataDirectory|\aspnet-ContosoUniversity.mdf" MatchAttributes="$(UpdateFromConnectionStringAttributes)" />
    </UpdateFrom>
    <Object Type="DbFullSql">
    <Source Path="..\aspnet-data-prod.sql" Transacted="False" />
    </Object>
    </ObjectGroup>
    </Objects>
    </PublishDatabaseSettings>
    </PropertyGroup>
    <ItemGroup>
    <MSDeployParameterValue Include="$(DeployParameterPrefix)DefaultConnection-Web.config Connection String">
    <ParameterValue>Data Source=tcp:s11.Winhost.com;Initial Catalog=DB_81892_contoso;User ID=DB_81892_contoso_user;Password=******;Integrated Security=False;</ParameterValue>
    </MSDeployParameterValue>
    <MSDeployParameterValue Include="$(DeployParameterPrefix)SchoolContext-Web.config Connection String">
    <ParameterValue>Data Source=tcp:s11.Winhost.com;Initial Catalog=DB_81892_contoso;User ID=DB_81892_contoso_user;Password=******;Integrated Security=False;</ParameterValue>
    </MSDeployParameterValue>
    </ItemGroup>
    </Project>
     
    Last edited by a moderator: Oct 14, 2015
  2. Elshadriel

    Elshadriel Winhost Staff

    "Error 2 Web deployment task failed. (Could not deploy package.
    Unable to connect to target server."

    Are you trying to publish the database as well? I'm afraid that's not supported. Or you getting the error message on the initial connection? I can't tell because you also said it was validated which means it should be working. You could also try deleting and recreating the publish profile.
     
    Michael likes this.

Share This Page