<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Vesa "vesku" Juvonen : WSS 3.0</title><link>http://blogs.msdn.com/vesku/archive/tags/WSS+3.0/default.aspx</link><description>Tags: WSS 3.0</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How do we do SharePoint development, including TFS integration?</title><link>http://blogs.msdn.com/vesku/archive/2009/10/25/how-do-we-do-sharepoint-development-including-tfs-integration.aspx</link><pubDate>Sun, 25 Oct 2009 15:32:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9912618</guid><dc:creator>sonofthesun</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/vesku/comments/9912618.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vesku/commentrss.aspx?PostID=9912618</wfw:commentRss><description>&lt;p&gt;There’s lot of information available concerning development processes, automated builds and &lt;a href="http://en.wikipedia.org/wiki/Continuous_Integration"&gt;continuous integration&lt;/a&gt; in SharePoint development using Team Foundation Server, but unfortunately most of the information is in relatively high level or just concepts, but details are missing. It’s also fairly common misconception that setting for example automated build with &lt;a href="http://msdn.microsoft.com/en-us/teamsystem/dd408382.aspx"&gt;TFS&lt;/a&gt; is difficult – it’s not. &lt;/p&gt;  &lt;p&gt;Following chapters defines the practices we use in &lt;a href="http://www.microsoft.com/microsoftservices/en/us/home.aspx"&gt;MCS Finland&lt;/a&gt; during development and for setting up the automated daily builds from TFS for enterprise projects. We will concentrate on the development process and setting up automated build process, but I’ll give some additional context from the project management point of view as well.&lt;/p&gt;  &lt;p&gt;This content applies both SharePoint 2007 and 2010 development. There are minor changes and improvements with &lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ee514561.aspx"&gt;SharePoint 2010&lt;/a&gt; development, which are pointed out.&lt;/p&gt;  &lt;p&gt;In this blog post, we cover following topics&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Development process &lt;/li&gt;    &lt;li&gt;Visual Studio solution configuration &lt;/li&gt;    &lt;li&gt;TFS side configurations &lt;/li&gt;    &lt;li&gt;Automated testing environment setup &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Development process&lt;/h3&gt;  &lt;p&gt;Following picture defines in high level the process we used for our enterprise projects. Actual details depends of course on the project size and project team. Actual process or methodology depends as well on the project, but process is always based on the &lt;a href="http://en.wikipedia.org/wiki/Agile_software_development"&gt;agile approach&lt;/a&gt; with numerous iterations. Usually methodology used can be considered as adaptation from the &lt;a href="http://en.wikipedia.org/wiki/Scrum_(development)"&gt;SCRUM&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Development process" border="0" alt="Development process" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_thumb.png" width="539" height="393" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="540"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="24"&gt;         &lt;p align="center"&gt;&lt;strong&gt;#&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="364"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;1&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Requirements and tasks&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Project requirements and tasks are collected from project owners&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;2&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Collecting tasks to TFS&lt;/td&gt;        &lt;td valign="top" width="364"&gt;All tasks to be accomplished (also documentation) are entered as tasks to the team foundation server. Tasks are divided to iterations based on the initial plan of the project.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;3&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Virtualized development environments&lt;/td&gt;        &lt;td valign="top" width="364"&gt;All development environments are virtualized for easy management. Standardized base image has been created, which can be setup to server in matter of minutes. We commonly used centralized box to host our virtualized environment, but this depends also on project.          &lt;br /&gt;          &lt;br /&gt;Some consultants have 8GB on their laptop, making it as more appropriate and flexible hosting environment using Hyper-V.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;4&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Integration and testing servers&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Separate testing servers are part of the project setup, which are used to verify the delivery before installing that to customer environment. Automated builds are used and depending on the project, automated testing is being done, using process defined later in this blog post.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;5&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Evaluation of status&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Daily builds are being validated and based on the status and iteration schedule new deployments are being installed to the customer’s quality assurance environment. &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;6&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Quality assurance testing&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Customers can follow up the progress of the projects and give instant feedback, if there’s something to change. Release cycle to customer environment depends based on project, but is approximately two weeks to ensure that there’s constant dialog on the functionalities being developed. Quality assurance environment is also used as the acceptance testing environment, when production release is planned to be done.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;7&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Change requests and feedback&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Feedback and change requests from the quality assurance environment are tracked to team site and entered to TFS system for developers to see the possible changes and new tasks. All incoming change requests are prioritized and scheduled to iterations based on discussions with project owners.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;8&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Production installation&lt;/td&gt;        &lt;td valign="top" width="364"&gt;When first release can be done, QA environment is used for acceptance testing and decision to move forward is done. &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;9&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;End user feedback&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Since quite rarely projects end on the first production release, feedback and tasks are obviously collected from the end users to be processed to change requests and actual development tasks.&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Iteration and production release count obviously depends on the project.&lt;/p&gt;  &lt;h3&gt;Visual Studio Solution configuration&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_thumb_1.png" width="204" height="403" /&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;There are few things to do in the Visual Studio Solution level to enable automated builds, if you use Visual Studio 2008 in development. By default Visual Studio 2008 does not understand the solution packaging concept, so we need to enable this by modifying VS project file. Also by modifying the project settings, we can improve our development experience.&lt;/p&gt;  &lt;p&gt;In our case the &lt;em&gt;standard&lt;/em&gt; VS2008 project structure usually looks something like following.&amp;#160; There’s few things to notice from the solution structure.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Code is divided to multiple projects based on their usage models      &lt;ul&gt;       &lt;li&gt;&lt;strong&gt;ApplicationLogic&lt;/strong&gt; – contains business logic of the project, including all actual code manipulating data of the lists etc. If &lt;a href="http://msdn.microsoft.com/en-gb/library/dd203468.aspx"&gt;patterns and practices models&lt;/a&gt; are used, services, repositories etc. are placed here as well. &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Data&lt;/strong&gt; – this is project for the data objects, which are used to transfer information between different solution layers. For easy manipulation in the UI layer, all code is transferred to data objects, rather then transferring actual SharePoint objects. This also helps in unit testing. &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;FeatureReceivers&lt;/strong&gt; – this project has the custom feature receiver code. Code is separated, since feature receivers have to be placed to GAC in every deployment scenario. &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Resources&lt;/strong&gt; – this project contains the 12 hive files &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Solution.Assemblies&lt;/strong&gt; – project to create the *.Assemblies.wsp solution package &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Solution.Resources&lt;/strong&gt; – project to create the *.Resources.wsp solution package &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Web.UI &lt;/strong&gt;– Project containing all the code for web parts, web controls, http modules and code behinds for application pages &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;As you see, there’s actually two projects, which are used to generate solution packages. One for the &lt;em&gt;resources&lt;/em&gt; (stuff to goes to 12 hive) and one for the actual assemblies. This is controversy approach also in our team, but if the assemblies are separate from the resources, we can more easily and risk free, just update the actual code, without touching the xml files on disk. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;For the projects, which are outputting solution packages (wsp files), we’ve configured new .targets file, which contains separate settings for Debug and Release configurations. The Target WSSSolution has been configured as the default target to these project by &lt;a href="http://msdn.microsoft.com/en-us/library/cc441431.aspx"&gt;modifying project file&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_thumb_2.png" width="534" height="165" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Notice that output folder of the assemblies has been configured as “..\..\..\Binaries\Release\” in the Release configuration and that wsp package is also placed to the same folder using the above xml configuration. This is same relative path to folder what’s used by the TFS automated build process to output assemblies, before the whole folder is copied to drop location. Since the wsp package is also placed to this folder by default, it’s automatically copied to the drop location without any additional configurations. So we use the same relative path already in the development environments, so that we don’t need to change anything as part of the automated build process.&lt;/p&gt;  &lt;p align="left"&gt;&lt;strong&gt;How to debug efficiently in VS2008? &lt;/strong&gt;– This is quite common question, since in VS2008, there’s no native way debug the SharePoint customization efficiently, unless you’re using the &lt;a href="http://msdn.microsoft.com/en-us/sharepoint/aa905690.aspx"&gt;VS extensions for WSS 3.0&lt;/a&gt;. Since the extensions were introduced quite late and they didn’t first support TFS integration fully, we haven’t got used to utilize them in our projects. This does not however mean that you shouldn't use them.&lt;/p&gt;  &lt;p align="left"&gt;In our case, customers usually accept deployment of our assemblies to GAC, so don’t have to create CAS files for the deployments, which makes also the debugging little bit easier, since during development time, we can deploy our assemblies to the bin folder of the IIS application and start debugging without IIS recycles etc.&lt;/p&gt;  &lt;p align="left"&gt;This means that we’ve setup the output folder of the Visual Studio projects to bin folder of the IIS application and configured the web application to fully trust the assemblies (&amp;lt;trust level=&amp;quot;Full&amp;quot; originUrl=&amp;quot;&amp;quot; /&amp;gt; in the web.config – not good practice if CAS files are used). To avoid unnecessary application pool recycles, we’ve also added additional &lt;a href="http://msdn.microsoft.com/en-us/library/system.security.allowpartiallytrustedcallersattribute.aspx"&gt;AllowPartiallyTrustedCallers&lt;/a&gt; attribute to assembly, so that assemblies are loaded to IIS process memory runtime.&lt;/p&gt;  &lt;p align="left"&gt;After these settings have been done, only thing left to do, is to attach to IIS process (w3wp.exe). To make this as efficient as possible, we use &lt;a href="http://blogs.msdn.com/jannemattila/archive/2008/10/30/attaching-debugger-to-w3wp-exe-using-nice-and-easy-keyboard-shortcut.aspx"&gt;VS macro and short cut keys&lt;/a&gt; to establish the debug process. Basically this means that only thing we need to do to get the latest versions to development portal is to compile the code and press the shortcut in the Visual Studio. After you request the page from you browser, debugger get’s automatically attached and you can start debugging.&lt;/p&gt;  &lt;p align="left"&gt;&lt;strong&gt;What kind of third party tools we use?&lt;/strong&gt; – Actually none. Managing &lt;a href="http://msdn.microsoft.com/en-us/library/ms442108.aspx"&gt;solution manifest&lt;/a&gt; and the &lt;a href="http://msdn.microsoft.com/en-us/library/bb466225.aspx"&gt;ddf&lt;/a&gt; file is something which we do manually as part of the development process. Each person involved in the project has responsibility to keep the files in sync. Generally we aim to create stub versions of each control, web part and feature file in the first iterations of the project. Meaning that each feature file and template is already included in the package, even though it doesn’t do anything. Also each web part or control only write the purpose of the particular functionality – “This web part will provide the article comment functionality in later Iteration”. This way each iteration will just increase the functionalities, which are working as designed in &lt;em&gt;technical architecture for customization &lt;/em&gt;document.&lt;/p&gt;  &lt;p align="left"&gt;There’s lot of great third party tools available for the build process in the VS2008, but we have not decided to use them, since in the end manual updates do not take that long and if the process is automated, there’s no way to control what actually get’s packaged from VS structure. Meaning that if some features are not finalized yet for the solution package, we don’t need to add them to manifest and ddf.&lt;/p&gt;  &lt;p align="center"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p align="left"&gt;&lt;strong&gt;How about SharePoint 2010 environment with VS2010?&lt;/strong&gt; – When you develop SharePoint 2010 projects using Visual Studio 2010, solution package is by default compiled to the same output directories as the assemblies, so there’s no reasons for these additional configurations. Visual studio solution structure also looks quite different, since in VS2010, you’d place the code and &lt;em&gt;14 hive&lt;/em&gt; elements to same Visual Studio projects. &lt;/p&gt;  &lt;p align="left"&gt;In SharePoint 2010 development, the common way to divide the files between the Visual Studio projects is based on the functionalities, not based on the file types. This means that for example the MySite functionalities are compiled to single solution package and portal and collaboration customizations to other packages. This model enables you a way to test and version the functionalities independently.&lt;/p&gt;  &lt;p align="left"&gt;Debugging your customizations is extremely easy, since for all of the SharePoint customizations, this happens just by starting the debugging session directly from the Visual Studio IDE. Similar ways as for the 2007 environment, debugging happens in the same computer, where you develop your customizations. Target url for debugging is defined during the VS project creation or from the project properties.&lt;/p&gt;  &lt;p align="left"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_16.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_thumb_7.png" width="341" height="268" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How about SharePoint 2010 environment with VS2008?&lt;/strong&gt; – This is definitely valid option and quite easy to establish (it’s only references). If you want to migrate your customizations as fast as possible to SharePoint 2010, this is most likely the temporary option you’ll use. In this case, you’ll have to modify the VS2008 project types as declared above. Since VS2010 however improve the productivity of the developers, we strongly suggest to migrate your code to VS2010. &lt;/p&gt;  &lt;p&gt;VS2010 supports importing existing solution packages to your Visual Studio solution. This way you can relatively easily migrate your VS2008 package to VS2010. After importing, you’ll need to reconfigure the packaging model, which will require refactoring, since the Visual Studio 2010 solution structure is not total imitation from the &lt;em&gt;14 hive&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_14.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_thumb_6.png" width="477" height="329" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;TFS side configurations&lt;/h3&gt;  &lt;p&gt;In the TFS side, all we need to do is create the build agent and the build definition for the project. This is relatively trivial process, but basically we are enabling the automated build using standard TFS side configurations. Since we’ve configured the solution package to be dropped to the same locations as the compiled assemblies (dll files either in Debug or in Release folder), we actually don’t need to do any additional steps or configure any additional &lt;a href="http://msdn.microsoft.com/en-us/library/wea2sca5.aspx"&gt;msbuild&lt;/a&gt; settings of the build project.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/buckh/archive/2007/08/14/tfs-2008-a-basic-guide-to-team-build-2008.aspx"&gt;TFS 2008: A basic guide to Team Build 2008&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Some things to remember when you setup the build server&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Ensure that you have the proper assemblies installed and/or available on the build server. Setup is dependent on the decencies on your code. &lt;/li&gt;    &lt;li&gt;Ensure that the build service is running using domain account, which has access to the team project, so that the build service can get the latest version from the source safe &lt;/li&gt;    &lt;li&gt;Setup share to the build server or any staging server to where the compiled builds are stored, including the solution package &lt;/li&gt;    &lt;li&gt;Remember to setup proper cleaning process for the automated builds, since each build will consume space – this can be controlled using the retention policy of the build definition file &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Depending on your code and unit testing practices, you can also add unit testing as part of your code compilation. Since some of the SharePoint dependent code can be difficult to &lt;a href="http://en.wikipedia.org/wiki/Mock_object"&gt;mock&lt;/a&gt;, this might be difficult or require &lt;a href="http://msdn.microsoft.com/en-us/library/dd206942.aspx"&gt;third party tools&lt;/a&gt;.&lt;/p&gt;  &lt;h3&gt;Automated testing environment setup&lt;/h3&gt;  &lt;p&gt;TFS automated build only verifies that the code itself compiles, but there’s still additional tasks to be done to ensure that code can be deployed and that the actual use cases work as expected. Especially for the larger projects, we’ve created additional steps, which are used to imitate the customer installation of the customizations. This way after each automated build, we have similar upgraded version of the portal, that the customer would have. To automate this, we’ve added few scripts to be executed.&lt;/p&gt;  &lt;p&gt;The following model also decreases the inefficient working time of the tester to setup the actual testing environment, before the actual functionalities can be tested. We can certainly test some of the functionalities using automated testing, but for larger projects, it has been fairly common to have dedicated tester. &lt;/p&gt;  &lt;p&gt;In one of our centralized &lt;a href="http://technet.microsoft.com/en-us/library/cc753637(WS.10).aspx"&gt;hyper-v&lt;/a&gt; servers, we’ve setup a scheduled batch file, which is executed after the automated build process.&amp;#160; &lt;/p&gt;  &lt;div align="center"&gt;   &lt;table style="background-color: #eeeeee" border="0" cellspacing="0" cellpadding="2" width="502" align="center"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="500"&gt;           &lt;p align="left"&gt;set Folder=\\mcstfs\contosoautobuild              &lt;br /&gt;set FileMask=autowspbuild_*               &lt;br /&gt;set VMName=contosotest02               &lt;br /&gt;set SnapshotName=&amp;quot;18.10.2009 latest win updates&amp;quot; &lt;/p&gt;            &lt;p align="left"&gt;set LatestFile=              &lt;br /&gt;for /f &amp;quot;delims=&amp;quot; %%a in ('dir&amp;#160; /ad /b /o:d &amp;quot;%Folder%\%FileMask%&amp;quot;') do set LatestFile=%%a               &lt;br /&gt;if &amp;quot;%LatestFile%&amp;quot;==&amp;quot;&amp;quot; goto :eof               &lt;br /&gt;echo %LatestFile% &lt;/p&gt;            &lt;p align="left"&gt;powershell -command .\startsnapshot.ps1 %VMName% %SnapshotName%              &lt;br /&gt;echo Sleep for 3 minutes...               &lt;br /&gt;ping -n 240 localhost &amp;gt;nul               &lt;br /&gt;applybuild %LatestFile% %VMName% contoso\moss_admin pwd&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p&gt;As you can see from the batch file content, we first solve the latest solution file, continue with snapshot modifications and as final step installs the build to the particular virtualized environment.&lt;/p&gt;  &lt;p&gt;We use &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx"&gt;powershell&lt;/a&gt; to restore the status of the testing server to same status as in the production environment. This is done by using following powershell script, which restores the snapshot given as parameter to the script. &lt;/p&gt;  &lt;div align="center"&gt;   &lt;table style="background-color: #eeeeee" border="0" cellspacing="0" cellpadding="2" width="502" align="center"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="500"&gt;           &lt;p align="left"&gt;$VMname = $args[0]              &lt;br /&gt;$SnapshotName = $args[1]&lt;/p&gt;            &lt;p align="left"&gt;$VMManagementService = Get-WmiObject -Namespace root\virtualization -Class Msvm_VirtualSystemManagementService              &lt;br /&gt;$SourceVm = Get-WmiObject -Namespace root\virtualization -Query &amp;quot;Select * From Msvm_ComputerSystem Where ElementName='$VMname'&amp;quot; &lt;/p&gt;            &lt;p align="left"&gt;$Snapshots = Get-WmiObject -Namespace root\virtualization -Query &amp;quot;Associators Of {$SourceVm} Where AssocClass=Msvm_ElementSettingData ResultClass=Msvm_VirtualSystemSettingData&amp;quot; &lt;/p&gt;            &lt;p align="left"&gt;#Write $Snapshots.Length &lt;/p&gt;            &lt;p align="left"&gt;foreach($Snapshot in $Snapshots)              &lt;br /&gt;{               &lt;br /&gt;#&amp;#160;&amp;#160;&amp;#160; $Snapshot.ElementName               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if($Snapshot.ElementName -match $SnapshotName)               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; #Write $Snapshot.ElementName               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $TheSnapshot = $Snapshot               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }               &lt;br /&gt;}&lt;/p&gt;            &lt;p align="left"&gt;Write &amp;quot;Applying the snapshot...&amp;quot;              &lt;br /&gt;$result = $VMManagementService.ApplyVirtualSystemSnapshot($SourceVm, $TheSnapshot)               &lt;br /&gt;ProcessWMIJob($result) &lt;/p&gt;            &lt;p align="left"&gt;Write &amp;quot;Starting the VM...&amp;quot;              &lt;br /&gt;# Start the VM               &lt;br /&gt;$result = $SourceVM.RequestStateChange(2)&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p&gt;When this script has been executed, the virtualized environment is back online and the defined snapshot has been restored. Following step is to apply the actual build to the restored VM. For this the following script is used.&lt;/p&gt;  &lt;div align="center"&gt;   &lt;table style="background-color: #eeeeee" border="0" cellspacing="0" cellpadding="2" width="512" align="center"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="510"&gt;           &lt;p align="left"&gt;rem parameters: buildname, vmmachinename, username, password &lt;/p&gt;            &lt;p align="left"&gt;xcopy /y /s \\mcstfs\autobuild\%1 \\contosotest02\drop\%1\&lt;/p&gt;            &lt;p align="left"&gt;c:\pstools\psexec.exe \\%2 -u %3 -p %4 -w c:\drop\%1\release c:\windows\system32\cmd.exe /c c:\drop\%1\release\upgrade.bat http://%2 dev V12 V5&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p&gt;As you can see the script, we are copying the solution package from the TFS autobuild server to share located in the testing server (which was just started). After that we can execute the upgrade script on the testing server, which contains the project dependent script to upgrade the existing portal with the new version of the customizations.&lt;/p&gt;  &lt;p&gt;By using these relatively simple scripts we now have clean and updated environment for testing every single day with all the latest customizations. Model obviously decreases the overall project costs, since we don’t need to spend time setting up the environments manually.&lt;/p&gt;  &lt;h4&gt;How to further improve the process?&lt;/h4&gt;  &lt;p&gt;After the testing environment has been setup, we can also improve even further the process. Common improvements would be to add &lt;a href="http://msdn.microsoft.com/en-us/library/ms182536.aspx"&gt;web testing&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ms182561.aspx"&gt;load testing&lt;/a&gt; to this scenario. Due the extensive support for scripting, we can automate these to be included to the daily process. This would mean that after the testing environment has been setup, we start the automated web tests for use case validation and performance testing to ensure that new code has not dramatically decreased the performance.&lt;/p&gt;  &lt;p&gt;Web testing is again relatively trivial task to do with the Visual Studio and it provides quick way to ensure that basic functionalities are still working as expected. &lt;/p&gt;  &lt;p&gt;Performance testing uses the recorded web testing scripts and imitates larger load. Even though the development testing environment is not using same hardware as the production, we can do estimates and assumptions based on baseline tests. &lt;/p&gt;  &lt;p&gt;Baseline testing means that we have made tests in the customer environment and in testing environment using same customizations. If the new version is decreasing test environment performance for 20%, we can assume that the result would be most likely the same in the production. &lt;/p&gt;  &lt;h3&gt;Improvements in SharePoint 2010 for the process&lt;/h3&gt;  &lt;p&gt;As mentioned already earlier in this post, when you develop customizations for the SharePoint 2010 with Visual Studio 2010, there’s native support to compile solution packages to the output folder of the Visual Studio project, so there’s no need for any msbuild script changes.&lt;/p&gt;  &lt;p&gt;Other huge improvement is the native support for upgrade and versioning in the feature framework side. This will help to upgrade already existing portals and manage the versioning of the customizations. Traditionally in SharePoint 2007, this has been done with custom feature receivers, which modify the existing content. In SharePoint 2010, we have much more powerful tools to manage the portal lifecycle and to update the already existing content. Also the logging mechanism have been dramatically improved to help with customization troubleshooting, if deployments fails or something unexpected will happen.&lt;/p&gt;  &lt;p&gt;We’ll release lot of new information concerning the SharePoint 2010 development in upcoming months, so stay tuned.&lt;/p&gt;  &lt;h3&gt;Summary&lt;/h3&gt;  &lt;p&gt;Setting up the &lt;em&gt;standardized&lt;/em&gt; development process might seem like a large task, but when the environments and processes have been defined, it saves lot of resources to actual efficient project work. The processes we use for our enterprise projects (30-500-xxxx man day projects), is constantly evolving process, which is improved and changed based on the experiences from the projects. &lt;/p&gt;  &lt;p&gt;Following people have also contributed to our &lt;em&gt;standardized&lt;/em&gt; process: Jaakko Haakana, Juhani Lith, &lt;a href="http://blogs.msdn.com/jannemattila/"&gt;Janne Mattila&lt;/a&gt;, Tom Wik and &lt;a href="http://blogs.msdn.com/jukka/"&gt;Jukka Ylimutka&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Hopefully this was useful. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9912618" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vesku/archive/tags/WSS+3.0/default.aspx">WSS 3.0</category><category domain="http://blogs.msdn.com/vesku/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.msdn.com/vesku/archive/tags/Development+practices/default.aspx">Development practices</category><category domain="http://blogs.msdn.com/vesku/archive/tags/TFS/default.aspx">TFS</category><category domain="http://blogs.msdn.com/vesku/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category></item><item><title>Project planning and application lifecycle management</title><link>http://blogs.msdn.com/vesku/archive/2008/09/16/project-planning-and-application-life-cycle-management.aspx</link><pubDate>Tue, 16 Sep 2008 21:00:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8954192</guid><dc:creator>sonofthesun</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/vesku/comments/8954192.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vesku/commentrss.aspx?PostID=8954192</wfw:commentRss><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;One of the most important and often overlooked thing to cover in planning phase of the projects is the application lifecycle management (ALM) for upcoming portal. In this context I don't mean just the lifecycle management for the customizations, rather for the full process and environments. Every single project done with SharePoint technologies (WSS/MOSS), should define the clear rules and practices to manage the process as early as possible.&lt;/p&gt; &lt;p&gt;By setting the ground rules immediately in the planning phase of the project, you can take them into account during the technical planning of the deployment and of course also in the operational planning. Following image and table defines one example process, which follows the continuous integration model for SharePoint development (&lt;a href="http://blogs.msdn.com/vesku/archive/2008/07/29/continuous-integration-in-moss-development-using-tfs.aspx"&gt;Continuous integration in MOSS development using TFS&lt;/a&gt;). &lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/Architectureplanningandportallifecyclema_108DF/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="403" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/Architectureplanningandportallifecyclema_108DF/image_thumb.png" width="545" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Following table defines the steps and phases one-by-one.&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="522" border="1"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="48"&gt; &lt;p align="center"&gt;&lt;strong&gt;#&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;&lt;strong&gt;Phase / Element&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="51"&gt; &lt;p align="center"&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;Developers develop individual features and functionalities based on of the technical specification using their independent virtualized environments, which have access to the TFS server for work items, source control etc.&lt;/p&gt; &lt;p align="justify"&gt;Virtualized environment have to be in-sync with the production environment concerning the licensing and patching. Customizations developed with enterprise license; don't necessarily work in standard environment. Patches and service packs should be also keep in sync.&lt;/p&gt; &lt;p align="justify"&gt;Ensure that it's somebody’s responsibility to keep the virtualized environment up to date.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="53"&gt; &lt;p align="center"&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;TFS Server used to store source code and other project related information. Developers can also sync their environment using the artifacts stored in TFS.&lt;/p&gt; &lt;p align="justify"&gt;It's obvious, that developers have to have ensured connection to the source control repository.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="55"&gt; &lt;p align="center"&gt;&lt;strong&gt;3&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;SQL Server instance of the TFS, used for actual storage of the different artifacts and document. Ensure that this database is fully managed, monitored and operational; otherwise the development cannot be conducted.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="55"&gt; &lt;p align="center"&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;Development integration server, which is used to verify the builds from the TFS, preferable using automated build process. Server should be kept in sync with the production environment.&lt;/p&gt; &lt;p align="justify"&gt;Integration server is used for integration and deployment testing. Also the initial functional testing for full package should be conducted in this environment.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="56"&gt; &lt;p align="center"&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;Project members (for example project manager, testers and even customers representatives in some cases) can follow the progress of the project and give feedback based on the builds deployed.&lt;/p&gt; &lt;p align="justify"&gt;Define the ground rules for accepting the deployments to quality assurance environment from the integration environment. &lt;/p&gt; &lt;p align="justify"&gt;If the development happens in ISV premises, this server is most likely located also there. It's not however good practice to have similar server in these cases also at the customer premises, so that it can be used to deploy pilot or draft versions of the solution. This way we can establish communication channels concerning the upcoming features as soon as there's something to deploy. This approach minimizes surprises at the end of the project and the customer representatives&amp;nbsp; can use the environment for training purposes as early as possible&lt;/p&gt; &lt;p align="justify"&gt;There has to be clear rules to follow for accepting the deployment for following phases.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="56"&gt; &lt;p align="center"&gt;&lt;strong&gt;6&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;Quality assurance environment used for functionality testing and acceptance testing. In ideal world this environment is identical as the production environment, so that it can also be used for load testing. Quite often though, the environment is virtualized for more convenient maintenance. &lt;/p&gt; &lt;p align="justify"&gt;Load testing can be nevertheless conducted also in virtualized environment, if project performs the initial load testing (base line testing) during the first version of the portal. This way the future load testing results can be compared to these base testing values.&lt;/p&gt; &lt;p align="justify"&gt;In sense of licensing and configuration, the environment should be completely identical to production. This ensures that if the deployment is successful in this environment, it will work also in production.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="56"&gt; &lt;p align="center"&gt;&lt;strong&gt;7&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;SQL Server of the quality assurance environment. Obviously the configuration should be identical as for the production. Operational setup should also follow the production, so that full portal behavior can be observed also in this environment.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="56"&gt; &lt;p align="center"&gt;&lt;strong&gt;8&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;MOSS environment used for production purposes. There should be clear responsibilities and operational guidance for this environment to ensure that possible issues caused for example customizations can be solved in timely fashion.&lt;/p&gt; &lt;p align="justify"&gt;One of the key things to document and to follow is the version handling model of the customizations (how things are updated). As written earlier, there has to be crystal clear model for deployment of new versions and guidance to follow in case of any issues encountered.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="56"&gt; &lt;p align="center"&gt;&lt;strong&gt;9&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;SQL Server for the production, which is fully managed and monitored 24/7. In case of any issues, there should be clear guidance on how to proceed. Backup and restore process should be verified in quality assurance environment and if possible also in production environment, before going live with the portal.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Considerations&lt;/h3&gt; &lt;p&gt;Following chapters defines few points to consider when the full process is planned. I also want to raise few pointers, which I have personally run into in multiple partners and customers.&lt;/p&gt; &lt;h4&gt;Are the code and SharePoint artifacts in safe place?&lt;/h4&gt; &lt;p&gt;It should be clear that the all of the customizations developed for SharePoint portal are stored in some source control system, like Team Foundation Server. You don't want be in situation where the customization are gone, due failure in single laptop or desktop. Also consider and ensure that the source control system is in safe hands. If there's critical issues in the production, which requires instant code level fix to be deployed, you need to ensure that the source control is up and running. &lt;/p&gt; &lt;p&gt;Basically this means that the source control system should be high available or at least there's a backup plan to access the source code in timely fashion, so for example possible SLA's can be achieved.&lt;/p&gt; &lt;h4&gt;Is the process high available?&lt;/h4&gt; &lt;p&gt;We need to go through the steps in the process to ensure that there's no single point of failure in the process. Technical failures can be fairly easily identified, but we also need to consider the steps, which require human intervention. You don't want to be dependent from single persons, which could compromise the environment for example during summer vacation. There needs to be a back up person for each critical responsibility, with sufficient knowledge concerning the possible tasks to be done.&lt;/p&gt; &lt;h4&gt;Is there clear model to update the customizations?&lt;/h4&gt; &lt;p&gt;Setting up the initial version of the portal is quite straight forward, but the possible updated versions have to be carefully designed. It's quite common that after the initial version, there will be additional functionalities included in the portal. At some customers, there are quarterly releases, which enhance the functionalities provided for the end users by introducing new possibilities and options. If the upgrading model is not clear before the initial customizations are deployed, life can get complicated. Can we use the in-place upgrade of the solution packages? Does the end users use SharePoint designer in production? Every decision has it's effect and there for we need to ensure the model already in the planning phase.&lt;/p&gt; &lt;p&gt;Personally I've seen way too many SharePoint deployments, which have been build up nicely, but when we need to update any of the customizations, the life get's over complicated.&lt;/p&gt; &lt;h4&gt;Is the customization deployment model scalable?&lt;/h4&gt; &lt;p&gt;The usage of the solution package in deployment of the customizations can be considered as the de-facto way of deploying ANY customizations to the portal. By using solution packages we can ensure that in case of increased load for the MOSS farm, we can scale the farm out, by adding additional servers. If the deployments are done manually, there's too huge risk for human errors and the servers won't be in-sync. Manual deployment would require also huge amounts of additional actions to be conducted when the new server is introduced to the farm.&lt;/p&gt; &lt;h3&gt;Summary&lt;/h3&gt; &lt;p&gt;I listed only few pointers to give you an idea of the things to cover in you project. Of course model and required processes is fully dependent on the scale of the deployment. If you only use closely out of the box SharePoint installations and the modifications are done using SharePoint Designer, you don't necessarily have to think through these kinds of things. For large scale projects, the models and processes have to be planned carefully. It's not rocket science and you should not over think the processes, but by planning a head, you can ensure the long running service, which will be definitely worth of investment.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8954192" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vesku/archive/tags/WSS+3.0/default.aspx">WSS 3.0</category><category domain="http://blogs.msdn.com/vesku/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.msdn.com/vesku/archive/tags/Governance/default.aspx">Governance</category><category domain="http://blogs.msdn.com/vesku/archive/tags/Development+practices/default.aspx">Development practices</category><category domain="http://blogs.msdn.com/vesku/archive/tags/TFS/default.aspx">TFS</category></item><item><title>Continuous integration in MOSS development using TFS</title><link>http://blogs.msdn.com/vesku/archive/2008/07/29/continuous-integration-in-moss-development-using-tfs.aspx</link><pubDate>Tue, 29 Jul 2008 19:58:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8789370</guid><dc:creator>sonofthesun</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/vesku/comments/8789370.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vesku/commentrss.aspx?PostID=8789370</wfw:commentRss><description>&lt;p&gt;I've been delivering quite a few technical training's during past year and one of the most discussed thing is the setup of the development environments for large scale projects. Especially large ISV's are really interested on the the practicalities of utilizing the &lt;a href="http://msdn.microsoft.com/en-us/tfs2008/default.aspx" target="_blank"&gt;TFS&lt;/a&gt; as the continuous integration (CI) and/or application lifecycle management (ALM) platform. For standard .net projects this has been the way to manage large projects and it's obvious that the investment and practices are wanted to be utilized also for the SharePoint based development. &lt;/p&gt; &lt;p&gt;Since SharePoint development differs quite a lot from the standard asp.net development, this has not been that straight forward. Following scenario is example done using Visual Studio and TFS, but the principles and practices can be easily adapted also for other continuous integration solutions, like the &lt;a href="http://sourceforge.net/projects/ccnet/" target="_blank"&gt;CruiseControl.NET (CCNet)&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Setting up the Visual Studio solution for the TFS&lt;/h3&gt; &lt;p&gt;Before the continuous integration can be setup in the TFS side, we need to configure the Visual Studio project correctly, so that when ever build is initialized, newly compiled solution package (.wsp) is&amp;nbsp; created. There are numerous blog entries available from the Internet including the detailed steps for this.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc441431.aspx" target="_blank"&gt;MSDN - Automating Solution Package Creation for Windows SharePoint Services by Using MSBuild&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Basically the idea is to configure the Visual Studio solution such away that each assembly is first compiled and then the solution package is compiled using the MakeCab.exe. For the VS solution where you have multiple projects, make sure that you have defined the project dependencies such away that that the actual solution package project (the one which output is the wsp file) is dependent on the assembly projects (outputs dll's). This ensures that the assembly projects are compiled, before the wsp package is generated.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Creating the auto build project for TFS&lt;/h3&gt; &lt;p&gt;When the auto build process of the TFS has finalized by compiling the Visual Studio solution, we have received fully package solution package(s), which are ready to be deployed to any SharePoint server. Since the TFS is not aware of these kind of file types, it does not by default copy the wsp package to the drop location. This is not an issue, since we can modify little bit the build project to be able to initiate the portal recreation.&amp;nbsp; By opening the build project file (by default TFSBuild.proj located in the TeamBuildType/[build name]/ folder in TFS source control) and adding following xml elements, we make sure that the wsp package is also copied to the drop location and additional batch file (this case the rebuild.bat) is executed.&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="575" border="1"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="573"&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;&lt;br&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Target&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;Name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;AfterCompile&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Copy&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;SourceFiles&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;$(SolutionRoot)\[TFSProjectName]\[ProjectName]&lt;br&gt;                    &lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;\SolutionFiles\Package\[SolutionPackageName].wsp&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;br&gt;        &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;DestinationFolder&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;$(DropLocation)&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; /&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Exec&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;Command&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;C:\TFS\rebuild.bat&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;br&gt;        &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;WorkingDirectory&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;$(DropLocation)&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; /&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Target&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;em&gt;Note. Above example of using rebuild.bat is dependent on the fact that the SharePoint is located in the same server as where the build happens, which in most of the time, is not the case. Alternative solution is declared in the following chapter.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Really nice feature concerning the auto build is also the fact that operations and actions logged by the MakeCab are automatically included in the TFS auto build report, which is generated for each executed auto build. If there's anything wrong with your solution files (manifest, ddf etc.), the errors will be automatically logged here. Each executed build has it's own detailed information, from where you can access the build log as we can see from the following image.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="377" alt="Build Information" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/image_thumb.png" width="504" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Build log (BuildLog.txt) has huge amounts of details concerning the actions taken in particular build. All the MakeCab logged information is also included in the log for detailed analyses on the SharePoint solution package compilation.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="339" alt="Build Log" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/image_thumb_1.png" width="504" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Adding rebuild of the portal to scenario&lt;/h3&gt;
&lt;p&gt;When the wsp package has been created, it has to be of course deployed to the portal first, before it can be tested. This can accomplished manually, but it can also be automated, so that the portal is recreated automatically as part of the auto build process. &lt;/p&gt;
&lt;p&gt;Personally I have done this few different ways. Initially I created a console application, which was executed as a scheduled task by the Windows OS. More convenient way to do the same would be to create few new extensions to the &lt;a href="http://technet.microsoft.com/en-us/library/cc288981.aspx" target="_blank"&gt;stsadm&lt;/a&gt;, which are responsible of setting up the environment, so that project members can access the latest version without any manual intervention. If the build server and SharePoint server are different servers (most likely the case), you can schedule the execution of the stsadm commands to batch file located in the server of the drop location.&lt;/p&gt;
&lt;p&gt;Following defines one approach used. The tasks are dependent on the type of development and can be customized based on your requirements.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Objectives&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Redeploy the new solution package to the farm - remove any previous versions, if exists 
&lt;li&gt;Recreate the portal hierarchy using portal site definitions 
&lt;li&gt;Define access to the newly created hierarchy for the project managers and testers&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;For these objectives, I created following stsadm extensions, which are sequentially processed. These commands access the farm using object model. By default the stsadm provides already similar functionalities, but by creating my own commands, I can easily improve and/or add any actions to be deployed as part of the auto build process. &lt;/p&gt;
&lt;table cellspacing="0" cellpadding="2" width="513" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="165"&gt;Command&lt;/td&gt;
&lt;td valign="top" width="346"&gt;Description&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="169"&gt;deploysolutionadv&lt;/td&gt;
&lt;td valign="top" width="346"&gt;Responsible of deploying the new solution package to the farm. Retracts and removes any previous versions from the farm, if exits.&lt;br&gt;&lt;br&gt;Command is used to redeploy the solution package as part of the daily builds.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="173"&gt;recreatesitecollection&lt;/td&gt;
&lt;td valign="top" width="346"&gt;Command recreates site collection using specific template defined as parameter. If site collection already exists in the farm, it's deleted.&lt;br&gt;&lt;br&gt;Command is used to recreate the site collection for the daily builds. Portal site definitions are great way of providing immediately full hierarchies for the newly created site collection.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="177"&gt;assignuserstogroup&lt;/td&gt;
&lt;td valign="top" width="346"&gt;Grant access to defined site collection for the users defined as parameter. &lt;br&gt;&lt;br&gt;Command is used to define access to the newly created site for the persons responsible of verification tasks.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Full scenario for continuous integration&lt;/h3&gt;
&lt;p&gt;Following image defines the key steps for the continuous integration within the SharePoint development. This model can be considered as the development time process for the project. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/New%20Picture%20(3)_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="418" alt="CI for MOSS development" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/New%20Picture%20(3)_thumb_1.png" width="520" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Following table defines the steps and phases one-by-one.&lt;/p&gt;
&lt;table cellspacing="0" cellpadding="2" width="518" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="26"&gt;
&lt;p align="center"&gt;&lt;strong&gt;#&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td valign="top" width="490"&gt;
&lt;p align="justify"&gt;&lt;strong&gt;Phase / Element&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="31"&gt;
&lt;p align="center"&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td valign="top" width="490"&gt;
&lt;p align="justify"&gt;Developers develop individual features and functionalities based on module plan (part of the technical specification) using their independent virtualized environments, which have access to the TFS server for work items, source control etc.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="36"&gt;
&lt;p align="center"&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td valign="top" width="490"&gt;
&lt;p align="justify"&gt;TFS Server used to store source code and other project related information. TFS is scheduled to build the integrated version of the package using build automation functionalities.&lt;/p&gt;
&lt;p align="justify"&gt;Developers can also sync their environment using the artifacts stored in TFS.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="41"&gt;
&lt;p align="center"&gt;&lt;strong&gt;3&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td valign="top" width="490"&gt;
&lt;p align="justify"&gt;Development integration server, which is used to setup the outputs from the TFS. If required, this server environment can be utilized by multiple projects as long as they have separate application on which the solution is automatically deployed (often the case in ISV environments).&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="45"&gt;
&lt;p align="center"&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td valign="top" width="490"&gt;
&lt;p align="justify"&gt;Project members (for example project manager, testers and even customers representatives in some cases) can follow the progress of the project and give feedback based on the builds deployed.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div align="justify"&gt;By providing instance access to daily builds, project will get instant feedback for the developed functionalities&lt;/div&gt;
&lt;li&gt;
&lt;div align="justify"&gt;Daily builds provide flexibility to follow the progress and to discover any required changes in the design as early as possible&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Possibilities to test and verify the provided functionalities in the development integration server depend heavily on the type of the solution to build. In case declared above, complete custom site definitions with initial configuration of custom web parts are included and there for when the portal site definition is used to create the structures, new functionalities are directly visible in the portal. &lt;/p&gt;
&lt;p&gt;On the other hand, it's quite common that you are developing functionalities, which are associated to the out-of-the-box site definitions using site stapling techniques. In these kind of projects, the new functionalities would be available, as long as you create the definitions, on which the stapling has been added.&lt;/p&gt;
&lt;p&gt;Even though you would be developing only few custom web parts, by utilizing the deployment model as declared above, you could verify the deployment packages for your project and test the web parts in the environment. If you are only adding few new web parts to out-of-the-box portal, you might want to consider automated activation of your custom features, which deploys the .webpart files to the portal. This way the tester(s) could verify the functionalities by adding new web parts to the portal using standard web part picker.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;SharePoint artifact development&lt;/h3&gt;
&lt;p&gt;One of the thing to consider when setting up the project is the storage location of the SharePoint artifacts. Even though SharePoint provides version control for artifacts it stores, it cannot be considered as a actual source control system. Especially if the development is done by ISV, which is the most common case, it's good to have the source code including the artifacts in sync in the source code system (like TFS) to be able to label the actual releases of the developed features. Consider the practicalities to update your customizations from version 1.0 to 2.0 (I'll write later practices for version handling of your SharePoint project).&lt;/p&gt;
&lt;p&gt;Artifact development on the ISV side can of course utilize the standard SharePoint tools, like SharePoint Designer, which increase the productivity during the initial creation of the functionalities. There's however no easily way to sync the artifacts from SharePoint to the Visual Studio package responsible of the encapsulating the solution packages. Whenever the development for particular artifact is finalized, it can be however copied to the package manually. This way for example the master page developer, can first finalize and verify the functionalities in her/his own virtualized environment and provide versions to the official solution package when appropriate.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Real life experiences&lt;/h3&gt;
&lt;p&gt;I initially created this process and the necessary configurations for one enterprise project, which started July 2007, where I was acting as the technical lead for the infrastructure architecture and for the customized development (at the time project started developers from ISV didn't have that much experience on the customization models). Overall amount of developers in the project was up to seven persons and since the development happened at customer premises, the daily builds provided easy way for the customer representatives to follow the progress and give instant feedback whenever required. &lt;/p&gt;
&lt;p&gt;Similar setup would be however extremely useful for also any ISV, which does SharePoint development. Since the recommended deployment method for any customizations in the SharePoint landscape is to use &lt;a href="http://msdn.microsoft.com/en-us/library/aa543214.aspx" target="_blank"&gt;solution packages&lt;/a&gt;, this process would be useful to any development project, no matter the amount of the customizations (from one web part to enterprise projects with tens of developers).&lt;/p&gt;
&lt;p&gt;One additional advantages from automation came as a surprise during the project - or initially it was not foreseen. One of the guidelines we kept in the project was to utilize immediately fresh copy of the virtualized environments, if unexplained errors were encountered during development, that could not be solved in timely fashion. By utilizing the same process as for the auto build, we could recreate the full portal for the development environment from scratch (huge WCM portal) just by running the predefined batch files. This decreased the time required for setting up the development environments with latest build and there for saved project resources for actual activities to be completed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Summary &amp;amp; more information&lt;/h3&gt;
&lt;p&gt;Utilization of continuous integration practices within the SharePoint development projects provides fairly easy way to increase the quality of the delivered functionalities. The process might first seem difficult, but when the initial configurations and actions have been completed, process can be reproduced easily to any number of projects. &lt;/p&gt;
&lt;p&gt;Links to the concepts defined in this blog post&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms181710(VS.80).aspx" target="_blank"&gt;Overview of Team Foundation Build&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb417382.aspx" target="_blank"&gt;How to: Extend the STSADM Utility&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa543214.aspx" target="_blank"&gt;SharePoint Solutions Overview&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc441431.aspx" target="_blank"&gt;Automating Solution Package Creation for Windows SharePoint Services by Using MSBuild&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;I'll write more guidelines concerning the ALM (Application Lifecycle Management) and other project practices for SharePoint development in upcoming posts.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8789370" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vesku/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/vesku/archive/tags/WSS+3.0/default.aspx">WSS 3.0</category><category domain="http://blogs.msdn.com/vesku/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.msdn.com/vesku/archive/tags/Development+practices/default.aspx">Development practices</category><category domain="http://blogs.msdn.com/vesku/archive/tags/TFS/default.aspx">TFS</category></item></channel></rss>