VSTS构建不会删除Web应用程序的所有文件 [英] VSTS Build Not Dropping All Files for Web Application

查看:83
本文介绍了VSTS构建不会删除Web应用程序的所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我开始写这个问题时,我的问题是在成功进行VSTS Build之后,我看不到与要发布的Web应用程序项目有关的文件.仅存在解决方案中某些其他项目的文件.但是,我遇到了这个问题,这有所帮助.

When I started writing this question, my problem was that after a successful VSTS Build, I wasn't able to see the files relating to my web application project for release. Only the files from certain other projects in the solution were present. However, I just came across this question, which has helped.

在更改Build中 Content 设置的配置(即该项目下Bin文件夹的内容)的配置后,我现在可以看到我的Web应用程序项目的已编译.dll文件.但是我看不到将构建的Web应用程序复制到服务器所需的其他文件-视图,脚本,css等.

I can now see the compiled .dll files for my web application project, after altering the configuration of the Content setting in the Build - that is, the contents of the Bin folder under that project. But I can't see anywhere the other files I need to copy the built web application to my server - the views, the scripts, the css, etc.

我发现VSTS的构建和发布"功能的强大功能和灵活性非常令人困惑,因为它完全满足了我们的要求.到目前为止,我只是在Visual Studio中的Web应用程序项目上单击鼠标右键,选择发布",并使用了文件系统发布方法.简单的.现在,我想自动化应用程序的构建和部署,它要复杂很多倍!

I'm finding the power and flexibility of VSTS's Build and Release functionality very confusing as it's complete overkill for our requirements. Up until now, I've just right-clicked on the web app project in Visual Studio selected Publish and used the File System publish method. Easy. Now that I want to automate the building and deploying of the application, it's many times more complicated!

因此,任何人都可以告诉我如何获得在VSTS中构建解决方案的方式,然后我可以使用发行定义"中的复制文件"任务将文件复制到我们的Web服务器(该服务器不是可以在Internet上看到,所以我使用的是本地托管的代理)?

So, can anybody tell me how I can get the solution to build in VSTS in such a way that I can then use a Copy Files task in the Release Definition to copy the files to our web server (the server isn't visible to the Internet so I'm using a locally-hosted Agent)?

推荐答案

根据您的评论,您已经从Visual Studio发布了该Web应用程序.通常,此操作将在Project/Properties/PublishProfiles文件夹下生成一个发布配置文件.您用于发布Web应用程序的设置存储在配置文件中.因此,您只需要确保已将此发布配置文件签入源代码管理即可.然后在TFS构建中,添加以下MSBuild参数:

Base on your comments, you have published the web app from Visual Studio. Usually, this action will generate a publish profile under Project/Properties/PublishProfiles folder. The settings you used to publish the web app is stored in the profile. So you just need to make sure this publish profile is checked into source control. And then in the TFS build, add following MSBuild arguments:

/p:DeployOnBuild=true /p:PublishProfile="publishprofile.pubxml"

这篇关于VSTS构建不会删除Web应用程序的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆