如何在FTP中使用AzureDevOps发布asp.net网站

问题描述 投票:0回答:1

我希望使用AzureDevOps作为我的CI / CD工具启用我的项目(asp.net api)。我希望我发布的文件通过FTP上传到我的托管服务提供商。

当前发生的情况是,当通过Azure DevOps构建产品时,它将产品创建为Msdeploy文件。我的托管服务提供商不支持通过ftp

Build

build steps

Build Artifactenter image description here

如您所见,构建工件是Web部署的格式

发布enter image description here尝试上传工件,即zip文件和ms部署文件。

上传文件后,服​​务器没有如何部署msdeploy项目文件。如何使用AzureDevOps部署网站

希望通过ftp上传的文件enter image description here

要么我想将文件上传为ftp支持的常规文件,要么我想以自动方式执行msdeploy

azure-devops ftp publishing msdeploy
1个回答
1
投票

此问题的解决方法是配置Visual Studio Build任务以将构建工件生成为文件而不是打包文件。

Visual Studio Build任务的默认MSBuild Arguments将以压缩包的形式输出构建工件,如上面发布的屏幕快照所示。

您可以尝试如下更改MSBuild Arguments。此msbuild参数会将生成工件作为常规文件输出到文件夹$(build.artifactstagingdirectory)\。

您可以通过FTP将文件发布到托管服务提供商。

/p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:publishUrl="$(build.artifactstagingdirectory)\\" /p:DeployDefaultTarget=WebPublish

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.