TFS 2015-构建解决方案,打包项目.同时建立一个不应该的解决方案 [英] TFS 2015 - Build solution, package project. Also building a solution it shouldn't be

查看:184
本文介绍了TFS 2015-构建解决方案,打包项目.同时建立一个不应该的解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含8个项目的解决方案,其中只有一个是网站/应用程序.其余所有程序都创建Web应用程序中引用的程序集.

I have a solution with 8 projects in it and only 1 of them is a web site/app. The rest all create assemblies that are referenced in the web app.

我要构建解决方案,然后将网站项目打包到Web部署程序包中.

I want to build the solution and then package the web site project into a web deploy package.

因此,在TFS中,我添加了Visual Studio Build步骤(此定义之后没有其他步骤),将其指向解决方案并添加了以下MSBuild参数:

So in TFS, I've added the Visual Studio Build step (no other steps in the definition after this), pointed it to the solution and added the following MSBuild arguments:

/p:DeployOnBuild = True/p:WebPublishMethod = Package/p:PackageAsSingleFile = true/p:SkipInvalidConfigurations = true/p:PackageLocation ="$(build.artifactstagingdirectory)\"

/p:DeployOnBuild=True /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\"

请注意,在TFS源代码管理中,有2个解决方案文件夹.对于此构建,我只想构建一种解决方案.因此,我已为它提供了所需解决方案的完整路径(不带通配符).

Note that in TFS source control, there are 2 solution folders. For this build, I just want to build one of the solutions. So I've given it the full path to the solution I want (without any wildcards).

构建成功,当我查看该目录(\ TfsData \ Build_work \ 1)时,它已经在其中创建了4个文件夹:'a','b','s'& "TestResults".

The build succeeds and when I look in that directory (\TfsData\Build_work\1), it has created 4 folders in there: 'a', 'b', 's' & 'TestResults'.

文件夹'a','b'& "TestResults"为空.

Folders 'a', 'b' & 'TestResults' are empty.

"s"文件夹中有一个"$ tf"文件夹,里面有很多东西,我不知道它是干什么的.

The 's' folder has a '$tf' folder with a bunch of stuff in there that I don't know what it's for.

"s"文件夹中也有两个解决方案.我不希望在此处构建/放置第二个解决方案.只是第一个.

The 's' folder also has BOTH solutions in there. I don't want the second solution build/placed there. Just the first one.

在第一个解决方案中找不到该Web应用程序的任何Web部署(zip)软件包.这只是内置的文件夹.

And I can't find any web deploy (zip) packages for the web app in the first solution. It's just the built folders.

推荐答案

  • S 代表Build.SourcesDirectory

    代理程序上用于下载源代码文件的本地路径.例如:c:\agent\_work\1\s

    A 代表Build.ArtifactStagingDirectory

    在任何工件被推送到目的地之前复制到的代理上的本地路径.例如:c:\agent\_work\1\a

    B 代表Build.BinariesDirectory

    代理上的本地路径,您可以将其用作已编译二进制文件的输出文件夹.例如:c:\agent\_work\1\b.

    根据您的描述,您需要

    According to your description, you need to cloak folders you don't need in source mappings under Repository of your build definition.

    此外,您必须使用复制并发布构建工件,以将构建工件发布到放置文件夹(服务器路径)或共享路径.

    Besides, you have to use Copy and Publish Build Artifacts to publish your build artifacts to drop folder(sever path) or a shared path.

    这篇关于TFS 2015-构建解决方案,打包项目.同时建立一个不应该的解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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