I am trying to deploy Asp.Net core 3.1 application using FTP publish profile. By visual studio its works fine but using dotnet CLI it ignores the FTP publish profile.
My FTP publish profile looks like this
<?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 https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FTP</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>dd4a9fd0-9d74-43ae-a752-4e60e7ac9fbc</ProjectGuid>
<publishUrl>ftp://***.***.****.com/</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
<FtpPassiveMode>True</FtpPassiveMode>
<FtpSitePath>
</FtpSitePath>
<UserName>ftpdeploy</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>netcoreapp3.1</TargetFramework>
<SelfContained>false</SelfContained>
<EnvironmentName>Development</EnvironmentName>
</PropertyGroup>
</Project>
I have tried
dotnet build "AsyncTomTomDemo.csproj" /p:DeployOnBuild=true /p:PublishProfile="FTPProfile" /p:Username="ftpdeploy" /p:Password="*******"
And
dotnet publish "AsyncTomTomDemo.csproj" /p:PublishProfile="FTPProfile" /p:Username="ftpdeploy" /p:Password="Ftpdepl0y@21"
It publishes at the default location "bin\debug.netcore3.1..." instead of FTP server
Here is the log it generates
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
AsyncTomTomDemo -> C:\JenkinsData\workspace\FTPDeployTest\AsyncTomTomDemo\AsyncTomTomDemo\bin\Debug\netcoreapp3.1\AsyncTomTomDemo.dll
AsyncTomTomDemo -> C:\JenkinsData\workspace\FTPDeployTest\AsyncTomTomDemo\AsyncTomTomDemo\obj\Release\netcoreapp3.1\PubTmp\Out\
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.10
If I create Folder profile this same command works.