Introduction

Microsoft Visual Studio 2012 provides a new set of tools for developing apps for Office and apps for SharePoint, as well as SharePoint farm and sandboxed solutions. By using these tools, developers can easily leverage the familiar Visual Studio environment and functionality to develop, debug, package, and deploy custom SharePoint solutions. Team development is also well-supported by these tools. You can check your SharePoint projects into Team Foundation Server (TFS) source control and build and package your projects in TFS Team Build. This article describes how to build SharePoint projects that were developed in Visual Studio 2012 by using Team Build, when neither Visual Studio 2012 nor SharePoint 2013 is installed on your build system. If Visual Studio 2012 and/or SharePoint 2013 are installed on the system, however, you can skip the steps below that outline how to patch the system with necessary dependencies.

If you're using TFS Online, you don't need to configure your own build system because the hosted build agent already has everything properly configured.

1.  Prepare the Build System
  • Install TFS Team Build
    If your build system already has TFS Team Build installed on it, you can skip this step. Otherwise, install and configure Team Build on your build system.
  • Install Windows SDK
    The Windows SDK must be installed on your build system because it includes the GACUtil tool. GACUtil is used to install the SharePoint Tool assemblies on the build system. You can download the Windows SDK from this location: http://msdn.microsoft.com/en-us/windows/bb980924.aspx. After you download the Windows SDK, install it. (Note that the PowerShell script referenced at the end of this article eliminates the need for this step.)
  • Install Build Support for Apps for Office and Apps for SharePoint
    To build apps for Office and apps for SharePoint projects, several components must be installed on your system.
  • Install SharePoint Farm and Sandboxed Solution Build Support
    Since SharePoint farm and sandboxed solution projects reference SharePoint Server assemblies, those SharePoint assemblies must be present on the build system.
    One way to do this is to install the full version of SharePoint Server 2013 on your build system. An advantage of having SharePoint installed is that you can use it to deploy and test your SharePoint application immediately after generating the WSP file. Note, however, that SharePoint Server 2013 can degrade your system performance, and it has increased system requirements (such as requiring a 64-bit CPU).
    As an alternative, you can download the required SharePoint assemblies onto your build system. For either method, you will need the proper license of SharePoint on the build system. Copy the following assemblies from the development system to the build system and put them in a Reference Assembly folder:
  • Microsoft.SharePoint.dll
  • Microsoft.SharePoint.Security.dll
  • Microsoft.SharePoint.WorkflowActions.dll
  • Microsoft.Office.Server.dll
  • Microsoft.Office.Server.UserProfiles.dll
  • Microsoft.SharePoint.Client.dll
  • Microsoft.SharePoint.Client.Runtime.dll
  • Microsoft.SharePoint.Client.ServerRuntime.dll
  • Microsoft.SharePoint.Linq.dll
  • Microsoft.SharePoint.Portal.dll
  • Microsoft.SharePoint.Publishing.dll
  • Microsoft.SharePoint.Taxonomy.dll
  • Microsoft.Office.SharePoint.Tools.dll
  • Microsoft.SharePoint.WorkflowActions.dll
  • Microsoft.Web.CommandUI.dll

        These files are located in the following folder on the development system:
       C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI
        It is recommended that you copy the SharePoint Server assemblies to the folder:
                .. \Program Files\Reference Assemblies\SharePoint\
        And then add one of the following registry entries:

  • For 64-bit systems:
    HKEY_LOCAL_SYSTEM\SOFTWARE\Microsoft\Wow6432Node\.NETFramework\v4.0.30319\AssemblyFoldersEx\SharePoint15]@="<AssemblyFolderLocation>"
  • For 32-bit systems:
    HKEY_LOCAL_SYSTEM\SOFTWARE\Microsoft\.NETFramework\ v4.0.30319\AssemblyFoldersEx\SharePoint15]@="<AssemblyFolderLocation>"

        If your SharePoint Projects refer to other SharePoint Server assemblies, copy them to the build system as well.

  • Install Office Developer Tools Assemblies to the GAC
    The following assemblies must be copied to the GAC of the build system:
  • Microsoft.VisualStudio.SharePoint.Designers.Models.dll
  • Microsoft.VisualStudio.SharePoint.Designers.Models.Features.dll
  • Microsoft.VisualStudio.SharePoint.Designers.Models.Packages.dll
  • Microsoft.VisualStudio.SharePoint.dll

These files are located in the following folder on the development system:
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\
If you also need localized versions of the files, you should also copy and install the corresponding resource DLLs to the GAC of the build system:

  • Microsoft.VisualStudio.SharePoint.Designers.Models.Features.resources.dll
  • Microsoft.VisualStudio.SharePoint.Designers.Models.Packages.resources.dll
  • Microsoft.VisualStudio.SharePoint.Designers.Models.resources.dll
  • Microsoft.VisualStudio.SharePoint.resources.dll
  • Install Required MSBuild Dependencies
    Copy and install the following custom targets and tasks folders to the corresponding folders on the build machine:
    • .. \Program Files\MSBuild\Microsoft\VisualStudio\v11.0\SharePointTools
    • .. \Program Files\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications
    • .. \Program Files\MSBuild\Microsoft\VisualStudio\v11.0\Web
    • .. \Program Files\MSBuild\Microsoft\Workflow Manager\1.0

    (For 64-bit systems, use "\Program Files (x86)" in the path above.)

  • Install Workflow Dependencies to the GAC
  • Microsoft.Activities.Design.dll

The file is located in the following folder on the development system:
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\

2. Build an App for Office or App for SharePoint Project, or a SharePoint Farm or Sandboxed Project

For information about how to build a SharePoint project, see the Team Build documentation
about setting up a build definition at Create a Build Definition and queue in the build.

3. Create a package for the Office Developer Tools Project

By default, building an app for Office or app for SharePoint app, or a SharePoint farm or sandboxed solution project in Visual Studio 2012 doesn't generate a package for the project. To generate a package for the project as part of the team build, you must include the correct parameters.

For app for Office and app for SharePoint projects, you must set the following parameters:

  1. To create package in build:
    /p:IsPackaging=true
  2. To set the publish directory in the same drop output location:
    /p:PublishDir=<droplocation>
  3. When your solution contains multiple app projects, set the following parameter to produce app specific publish directories:
    /p:AppSpecificPublishOutputs=true

For SharePoint farm or sandboxed solution projects to work, you only need to set IsPackaging=true.
A link to a customized build workflow sample for app scenarios is provided in the External Resources section at the end of this article.

4. Appendix

Use the following procedures to set up Team Build for SharePoint projects on TFS 2012:

Steps
App for Office App and App for SharePoint
Classic Solution 2013

1
Install Team Build software
Same procedure as the app project.

2
Install the Windows SDK to get its GACUtil tool, if you don't already have one on the build system.
Same procedure as the app project.

3

Install the following components:

  • Windows Identity Foundation (WIF)
  • WIF Extensions
  • SharePoint Client Component SDK
  • Workflow Client 1.0 and Workflow Manager 1.0 through WebPI

Skip this step.

4
Skip this step.

Install the following SharePoint assemblies:

  • Microsoft.SharePoint.dll
  • Microsoft.SharePoint.Security.dll
  • Microsoft.SharePoint.WorkflowActions.dll
  • Microsoft.Office.Server.dll
  • Microsoft.Office.Server.UserProfiles.dll
  • Microsoft.SharePoint.Client.dll
  • Microsoft.SharePoint.Client.Runtime.dll
  • Microsoft.SharePoint.Client.ServerRuntime.dll
  • Microsoft.SharePoint.Linq.dll
  • Microsoft.SharePoint.Portal.dll
  • Microsoft.SharePoint.Publishing.dll
  • Microsoft.SharePoint.Taxonomy.dll
  • Microsoft.Office.SharePoint.Tools.dll
  • Microsoft.SharePoint.WorkflowActions.dll
  • Microsoft.Web.CommandUI.dll

If your project references other SharePoint
assemblies, copy them to the build system too.

5

Install the following Office Developer Tools assemblies to GAC:

  • Microsoft.VisualStudio.SharePoint.Designers.Models.dll
  • Microsoft.VisualStudio.SharePoint.Designers.Models.Features.dll
  • Microsoft.VisualStudio.SharePoint.Designers.Models.Packages.dll
  • Microsoft.VisualStudio.SharePoint.dll

Same procedure as the app project.

6

Copy and install the following custom targets and tasks folders to the corresponding folders on the build machine:

  • .. \Program Files\MSBuild\Microsoft\VisualStudio\v11.0\SharePointTools
  • .. \Program Files\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications
  • .. \Program Files\MSBuild\Microsoft\VisualStudio\v11.0\Web
  • .. \Program Files\MSBuild\Microsoft\Workflow Manager\1.0

(For 64-bit systems, use "\Program Files (x86)" instead of "Program Files" in the paths above.)

Same procedure as the app project.

7

Add the following assembly to the GAC:

  • Microsoft.Activities.Design.dll

Same procedure as the app project.

8

Set the following parameters:

  1. To create a package in build:
    /p:IsPackaging=true
  2. To set the publish directory in the same drop output location:
    /p:PublishDir=<droplocation>
  3. When your solution contains multiple app projects, set the following parameter to produce app specific publish directories.
    /p:AppSpecificPublishOutputs=true

Set /p:IsPackaging=True

Script Support for Patching the Build System
Sample scripts are available to help automate the patching of the build system for SharePoint projects (see: http://officesharepointci.codeplex.com/). If SharePoint 2013, Visual Studio 2012 and Office Developer Tools are already installed on your developer system, you can run the script to collect all the necessary files in a folder. Then, copy this folder to the build system and run the script again to install the files to the proper locations.
The CodePlex project also contains a build workflow tailored for Office Developer Tools projects. The workflow will build the project, create the packages, and then call a user-specified deployment script to perform the deployment.

External Resources:
Office / SharePoint 2013 Continuous Integration with TFS 2012

How to Build Office Developer Tools Projects with TFS Team Build 2012的更多相关文章

  1. Office Developer Tools for Visual Studio 2012现在可用了

    [原文发表地址]   Now Available: Office Developer Tools for Visual Studio 2012 正如我以前写过的,我们正在为构建下一代Office和 S ...

  2. Developer tools

    20. Developer tools Spring Boot includes an additional set of tools that can make the application de ...

  3. Linux下安装Phalcon系统环境安装Phalcon 及 安装Phalcon Developer Tools

    一.安装Phalcon Phalcon 需要用的的PHP扩展函数有如下: curl gettext gd2 (to use the Phalcon\Image\Adapter\Gd class) li ...

  4. Chrome Developer Tools:Network Panel说明

    官方资料:Chrome Developer Tools: Network Panel 一.chrome Developer Tools:Network Panel 从网络面板中可以获取很多有用信息,如 ...

  5. eclipse中jsp文档无语法着色,安装Eclipse Java Web Developer Tools插件

    一.安装Eclipse Java Web Developer Tools插件 1.eclipse菜单:help/install New Software,打开Available Software窗体: ...

  6. React Developer Tools 安装小提示

    1,在google市场里边,安装React Developer Tools之后,发现是开启的,但是按下F12后,并没有发现react选项 2,后来通过查资料,发现必须是运行react项目的时候,才出现 ...

  7. ios 开发中 developer tools access 总是要输入密码问题的解决

    我一直没有想法去解决这个问题:打开iphone模拟器的时候,老是弹出developer tools access 让我输入密码, 今天我在打开模拟器的时候又弹出这个对话框,我愤怒了,于是我在网上查了一 ...

  8. ODAC with Oracle Developer Tools for Visual Studio

    c#开发Oracle数据库的时候,需要本机没有安装过 Oracle 客户端,直接下载 ODAC with Oracle Developer Tools for Visual Studio工具安装即可 ...

  9. 掌握Chrome Developer Tools:下一阶段前端开发技术

    Tips 原文作者:Ben Edelstein 原文地址:Mastering Chrome Developer Tools: Next Level Front-End Development Tech ...

随机推荐

  1. CDN 和 DNS

    原文地址:http://www.cnblogs.com/xitang/p/3575255.html 相信有很多的朋友会被这几个名词绕的有些头大,很多朋友觉得智能DNS跟双线加速.CDN加速是类似的技术 ...

  2. 【转】为什么很多看起来不是很复杂的网站,比如 Facebook、淘宝,都需要大量顶尖高手来开发?

    先说你看到的页面上,最重要的几个:[搜索商品]——这个功能,如果你有几千条商品,完全可以用select * from tableXX where title like %XX%这样的操作来搞定.但是— ...

  3. 《javascript模式》 容易踩中的那些坑

    1 链式赋值的陷阱 1: function func(){ 2: var innerVar = globalVar = 20; 3: } 4: func(); 5: console.log(typeo ...

  4. win7中的画图

    下午做一个图像篡改定位实验,在win7下对图像进行修改,然后通过其最低位判断篡改位置. 程序如何都调试不出来.反复简化程序,发现win7中的画图对图像存在优化. 当更改图像后,会自动调整当前图像的显示 ...

  5. 编写高质量JS代码的68个有效方法(八)

    [20141227]编写高质量JS代码的68个有效方法(八) *:first-child { margin-top: 0 !important; } body>*:last-child { ma ...

  6. 自定义能够for each的类,C#,Java,C++,C++/cli的实现方法

    自定义类能够被for each,应该算是个老生常谈的话题了,相关的资料都很多,不过这里整理总结主流语言的不同实现方式,并比较部分细节上的差异. 第一种语言,也是实现起来最简单的Java语言.在Java ...

  7. Erlang进程的Link机制

    这篇文章还不是最终版,有时间时,我会再来补充完善. 什么是link Erlang程序基于进程建模,进程之间的交互机制有收发消息,link和monitor.其中,收发消息通常用于正常的进程间通讯,而li ...

  8. js-初步了解

    一.javascript的由来 Javascript是一种web技术,最初起名叫LiveScript,它是Netscape开发出来一种脚本语言,其目的是为了扩展基本的Html的功能,用来替代复杂的CG ...

  9. IOS开发UI基础storyboard相关概念的认识

    本文主要介绍一些基本的概念 为后面的学习做个准备 需要了解的知识点有以下几个方面: storyboard文件的认识 IBAction 和IBOutlet UIViewController控制器的认识 ...

  10. 分析SIX锁和锁分区导致的死锁

    什么是SIX锁? 官方文档锁模式中说到: 意向排他共享 (SIX):保护针对层次结构中某些(而并非所有)低层资源请求或获取的共享锁以及针对某些(而并非所有)低层资源请求或获取的意向排他锁. 顶级资源允 ...