FTP如何发布dotnet core web后端?
How to publish dotnet core web back-end by FTP?
我想在不使用 Visual Studio.
的情况下发布 dotnet 核心程序
我使用了 dotnet build /p:DeployOnBuild=true /p:PublishProfile=FTP
(配置文件 FTP 在 Visual Studio 中没有任何问题)。但是这个命令运行后FTP网站上没有文件。我不知道这个命令的细节。所以我使用 FolderProfile 而不是 FTP 并且效果很好。 Micorsoft 文档没有 ftp 由 dotnet cli 发布的示例。
我的 FTP 个人资料是这样的:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FTP</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>**.**.**.**\api</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>28bdbda4-4eb1-4b10-b5bd-d150e6d9****</ProjectGuid>
<publishUrl>ftp://**.**.**.**</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<FtpPassiveMode>True</FtpPassiveMode>
<FtpSitePath></FtpSitePath>
<UserName>webadmin</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>netcoreapp2.2</TargetFramework>
<SelfContained>false</SelfContained>
<EnvironmentName>Test</EnvironmentName>
</PropertyGroup>
</Project>
是否有 ftp 通过 dotnet cli 发布的解决方案?
命令dotnet build -v n /p:DeployOnBuild=true /p:PublishProfile=FTP
:
结束于:
1>Project "FTPTest.sln" on node 1 (Restore target(s)).
1>ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Restore:
Committing restore...
Assets file has not changed. Skipping assets file writing.
Path: FTPTest\obj\project.assets.json
Restore completed in 51.54 ms for FTPTest.csproj.
NuGet Config files used:
C:\Users\*******\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
https://api.nuget.org/v3/index.json
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
1>Done Building Project "FTPTest.sln" (Restore target(s)).
1:2>Project "FTPTest.sln" on node 1 (default targets).
1>ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
1:2>Project "FTPTest.sln" (1:2) is building
2>GenerateTargetFrameworkMonikerAttribute:
Skipping target
"GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
_CoreGenerateRazorAssemblyInfo:
Skipping target "_CoreGenerateRazorAssemblyInfo"
because all output files are up-to-date with respect to the input files.
CoreGenerateAssemblyInfo:
Skipping target "CoreGenerateAssemblyInfo" because all output files are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
_CopyOutOfDateSourceItemsToOutputDirectory:
Skipping target
"_CopyOutOfDateSourceItemsToOutputDirectory" because all output files are up-to-date with respect to the input files.
_CopyOutOfDateSourceItemsToOutputDirectoryAlways:
GenerateBuildDependencyFile:
Skipping target "GenerateBuildDependencyFile" because all output files are up-to-date with respect to the input files.
GenerateBuildRuntimeConfigurationFiles:
Skipping target "GenerateBuildRuntimeConfigurationFiles" because all output files are up-to-date with respect to the input files.
CopyFilesToOutputDirectory:
FTPTest -> .\bin\Debug\netcoreapp2.2\**********.dll
_DeletePublishIntermediateOutputPath:
......some details......
Publish:
FTPTest -> .\obj\Release\netcoreapp2.2\PubTmp\Out\
No web.config found. Creating '.\obj\Release\netcoreapp2.2\PubTmp\Out\web.config'
2>Done Building Project ".\*******.csproj" (default targets).
1>Done Building Project "********.sln" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
我想在不使用 Visual Studio.
的情况下发布 dotnet 核心程序
我使用了 dotnet build /p:DeployOnBuild=true /p:PublishProfile=FTP
(配置文件 FTP 在 Visual Studio 中没有任何问题)。但是这个命令运行后FTP网站上没有文件。我不知道这个命令的细节。所以我使用 FolderProfile 而不是 FTP 并且效果很好。 Micorsoft 文档没有 ftp 由 dotnet cli 发布的示例。
我的 FTP 个人资料是这样的:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FTP</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>**.**.**.**\api</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>28bdbda4-4eb1-4b10-b5bd-d150e6d9****</ProjectGuid>
<publishUrl>ftp://**.**.**.**</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<FtpPassiveMode>True</FtpPassiveMode>
<FtpSitePath></FtpSitePath>
<UserName>webadmin</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>netcoreapp2.2</TargetFramework>
<SelfContained>false</SelfContained>
<EnvironmentName>Test</EnvironmentName>
</PropertyGroup>
</Project>
是否有 ftp 通过 dotnet cli 发布的解决方案?
命令dotnet build -v n /p:DeployOnBuild=true /p:PublishProfile=FTP
:
结束于:
1>Project "FTPTest.sln" on node 1 (Restore target(s)).
1>ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Restore:
Committing restore...
Assets file has not changed. Skipping assets file writing.
Path: FTPTest\obj\project.assets.json
Restore completed in 51.54 ms for FTPTest.csproj.
NuGet Config files used:
C:\Users\*******\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
https://api.nuget.org/v3/index.json
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
1>Done Building Project "FTPTest.sln" (Restore target(s)).
1:2>Project "FTPTest.sln" on node 1 (default targets).
1>ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
1:2>Project "FTPTest.sln" (1:2) is building
2>GenerateTargetFrameworkMonikerAttribute:
Skipping target
"GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
_CoreGenerateRazorAssemblyInfo:
Skipping target "_CoreGenerateRazorAssemblyInfo"
because all output files are up-to-date with respect to the input files.
CoreGenerateAssemblyInfo:
Skipping target "CoreGenerateAssemblyInfo" because all output files are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
_CopyOutOfDateSourceItemsToOutputDirectory:
Skipping target
"_CopyOutOfDateSourceItemsToOutputDirectory" because all output files are up-to-date with respect to the input files.
_CopyOutOfDateSourceItemsToOutputDirectoryAlways:
GenerateBuildDependencyFile:
Skipping target "GenerateBuildDependencyFile" because all output files are up-to-date with respect to the input files.
GenerateBuildRuntimeConfigurationFiles:
Skipping target "GenerateBuildRuntimeConfigurationFiles" because all output files are up-to-date with respect to the input files.
CopyFilesToOutputDirectory:
FTPTest -> .\bin\Debug\netcoreapp2.2\**********.dll
_DeletePublishIntermediateOutputPath:
......some details......
Publish:
FTPTest -> .\obj\Release\netcoreapp2.2\PubTmp\Out\
No web.config found. Creating '.\obj\Release\netcoreapp2.2\PubTmp\Out\web.config'
2>Done Building Project ".\*******.csproj" (default targets).
1>Done Building Project "********.sln" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)