使用 Web 部署包通过 TFS 2017 构建和部署 Web 应用程序 [英] Build and Deploy a Web Application with TFS 2017 using Web Deploy Package

查看:22
本文介绍了使用 Web 部署包通过 TFS 2017 构建和部署 Web 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题与此类似

但是对于 Web 应用程序,无论我在 MSBuild 参数中使用什么参数都不起作用,而且我不想将所有文件从项目复制到服务器,我想要一个不同于删除 .sln 的选项和其他文件从服务器释放后.

我尝试了 /p:DeployOnBuild=True/p:PublishProfile=$(DeploymentConfiguration) 并且我使用了作为 Web 部署包创建的发布配置文件,但是在工件中的构建之后我得到了相同的文件, 我的意思是包括 .sln 在内的所有项目文件.

当我使用 /p:DeployOnBuild=True/p:PublishProfile=$(DeploymentConfiguration) 时,我不确定在工件中应该期待什么,但我没有看到变化.

有人能解释一下在这种情况下我应该等待什么吗??以及如何使用 TFS 正确部署 Web 应用程序项目(因为当我使用 .pubxml 从 Visual Studio 发布工作正常时,在服务器中只复制权限文件)并且这个想法是在TFS 不使用任何来自 Visaal Studio 的手册.

欢迎提出任何想法和解释,谢谢.

解决方案

在我查看构建定义的 TFS 选项之前没有任何工作,当您必须为定义选择模板时,您可以看到两个选项构建和部署,我选择了 Build 的模板,但我尝试了一个部署选项:

默认情况下,在 MSBuild 参数中,参数是:/p:OutDir="$(build.binariesdirectory)\"

在该文件夹中,我们拥有部署所需的一切.

My problem is similar to this

Build and Deploy a Web Application with TFS 2015 Build

But, the solution is not working for me. I am working on Continuous Integration, and I have to Deploy a Web Application, and others Website, with the website I don't have problems creating the .zip Package for the deploy. I am using /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.StagingDirectory)\"

Then I am using Deploy IIS App for extract the .zip Package in the virtual directory for the website.

But with the Web Application no matter what Arguments I use in the MSBuild Arguments nothing works, and I don't want copy all the file from the project to the server, and I would like an option different from remove the .sln and other file after the release from the server.

I tried /p:DeployOnBuild=True /p:PublishProfile=$(DeploymentConfiguration) and I used a publish profile created as Web Deploy Package but after the build in the artifacts I get the same files, I mean all the projects files including .sln.

I am not sure what should I expect in the artifact when I use /p:DeployOnBuild=True /p:PublishProfile=$(DeploymentConfiguration), but I am not seeing changes.

Can someone explain me what should I wait in this case?? and How to deploy correctly the Web Application Project using the TFS (because when I publish from the Visual Studio using the .pubxml works fine, in the server just the rights file are being copied) and the idea is make the Build and Release in the TFS no using nothing manual from Visal Studio.

Any idea and explanation is going to be welcome, Thanks.

解决方案

Nothing was working until I was looking into the TFS options for Build Definitions and when you have to select a template for the definition, you can see two options Build and Deployment, I was selecting Build's template but I tried with a Deployment option :

and by default in the MSBuild Arguments the parameter is :/p:OutDir="$(build.binariesdirectory)\"

In that folder we have everything we need for the deployment.

这篇关于使用 Web 部署包通过 TFS 2017 构建和部署 Web 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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