<?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>John W Powell</title><link>http://blogs.msdn.com/johnwpowell/default.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Visual Studio Extensions for Windows SharePoint Services (VSEWSS) Error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/08/16/visual-studio-extensions-for-windows-sharepoint-services-vsewss-error-unable-to-load-one-or-more-of-the-requested-types-retrieve-the-loaderexceptions-property-for-more-information.aspx</link><pubDate>Sun, 16 Aug 2009 17:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9871640</guid><dc:creator>johnwpowell</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9871640.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9871640</wfw:commentRss><description>&lt;P&gt;One error you may see when packaging solutions with VSEWSS is:&amp;nbsp; &lt;EM&gt;Microsoft.SharePoint.Tools.Utilities.VSeWSSServiceException VSeWSS Service Error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.&amp;nbsp; &lt;/EM&gt;Like most error messages from VSEWSS, there is not enough information provided to resolve the issue, so I hope to save you some time by providing a workaround that will permanently fix this problem.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;When VSEWSS packages your solution, it uses reflection to enumerate the packaged assemblies.&amp;nbsp; It works fine until it encounters an assembly that implements an interface that is defined in another assembly as is often the case in the Microsoft.Practices.* assemblies.&amp;nbsp; I am unsure of exactly why, but the extensions are unable to resolve the dependent assemblies.&amp;nbsp; To work around the issue, you can copy the dependent assemblies to the GAC, but I don’t think this is the optimal solution and doing so will cause pain during development and debugging.&amp;nbsp; Another option is to copy the dependent assemblies to the VSEWSS service bin directory post build.&amp;nbsp; After trying this for awhile, and maintaining the script, I decided it would be much simpler to just copy all assemblies in my solution to the VSEWSS service bin directory on post build.&amp;nbsp; Here is the script:&lt;/P&gt;&lt;PRE class=csharpcode&gt;@&lt;SPAN class=kwrd&gt;rem&lt;/SPAN&gt;======================================================================
@&lt;SPAN class=rem&gt;rem&lt;/SPAN&gt;
@&lt;SPAN class=rem&gt;rem    This script copies assemblies to the VSEWSS bin directory&lt;/SPAN&gt;
@&lt;SPAN class=rem&gt;rem    to eliminate the packaging type load exception that occurs&lt;/SPAN&gt;
@&lt;SPAN class=rem&gt;rem    when an interface is defined in a separate assembly.&lt;/SPAN&gt;
@&lt;SPAN class=rem&gt;rem    &lt;/SPAN&gt;
@&lt;SPAN class=rem&gt;rem    usage call $(ProjectDir)Scripts/CopyAssembliesToVSEWSSBin.bat $(TargetDir)&lt;/SPAN&gt;
@&lt;SPAN class=rem&gt;rem&lt;/SPAN&gt;
@&lt;SPAN class=kwrd&gt;rem&lt;/SPAN&gt;======================================================================

@echo off

@echo ========== Locating VSEWSS bin directory ==========
@&lt;SPAN class=kwrd&gt;set&lt;/SPAN&gt; vsewssbin=%programfiles%\Microsoft SharePoint Developer Tools 9.0\svc\bin
&lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;not&lt;/SPAN&gt; exist &lt;SPAN class=str&gt;"%vsewssbin%"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;set&lt;/SPAN&gt; vsewssbin=%ProgramW6432%\Microsoft SharePoint Developer Tools 9.0\svc\bin
@echo VSEWSS bin: %vsewssbin%

@echo ========== Copying assemblies &lt;SPAN class=kwrd&gt;to&lt;/SPAN&gt; VSEWSS bin directory ==========
@xcopy &lt;SPAN class=str&gt;"%1*.dll"&lt;/SPAN&gt; &lt;SPAN class=str&gt;"%vsewssbin%"&lt;/SPAN&gt; /R /Y

&lt;/PRE&gt;
&lt;P&gt;To use the script, create a bat file in your project and call it from a post build event. It does take 64-bit installations into account, and it will also work on your Team Build server.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9871640" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Team+Build/default.aspx">Team Build</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/VSEWSS+1.3/default.aspx">VSEWSS 1.3</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/visual+studio+extensions/default.aspx">visual studio extensions</category></item><item><title>A Simple Build Script for Packaging Visual Studio Extensions for Windows SharePoint Services (VSEWSS 1.3) Projects with Team Build</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/08/16/a-simple-build-script-for-packaging-visual-studio-extensions-for-windows-sharepoint-services-vsewss-1-3-projects-with-team-build.aspx</link><pubDate>Sun, 16 Aug 2009 16:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9871609</guid><dc:creator>johnwpowell</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9871609.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9871609</wfw:commentRss><description>&lt;P&gt;In a &lt;A href="http://blogs.msdn.com/johnwpowell/archive/2009/06/21/automate-sharepoint-solution-builds-with-visual-studio-extensions-for-windows-sharepoint-services-vsewss-1-3.aspx" target=_blank mce_href="http://blogs.msdn.com/johnwpowell/archive/2009/06/21/automate-sharepoint-solution-builds-with-visual-studio-extensions-for-windows-sharepoint-services-vsewss-1-3.aspx"&gt;previous post&lt;/A&gt;, I provided a walkthrough for automating builds for VSEWSS 1.3 projects.&amp;nbsp; The script I used was based on the SharePoint Guidance Drop 11, and after using it, I felt it could be simplified.&amp;nbsp; I’m a proponent of implementing the “simplest possible thing that will work,” and the following build script contains the minimal functionality needed to automate the building and packaging of your SharePoint solutions.&lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=kwrd&gt;&amp;lt;?&lt;/SPAN&gt;&lt;SPAN class=html&gt;xml&lt;/SPAN&gt; &lt;SPAN class=attr&gt;version&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="1.0"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;encoding&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="utf-8"&lt;/SPAN&gt;?&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Project&lt;/SPAN&gt; &lt;SPAN class=attr&gt;xmlns&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="http://schemas.microsoft.com/developer/msbuild/2003"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;ToolsVersion&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="3.5"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Import&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Project&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ProjectExtensions&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ProjectFileVersion&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;2&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;ProjectFileVersion&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;ProjectExtensions&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;RunTest&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;false&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;RunTest&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;RunCodeAnalysis&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;Never&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;RunCodeAnalysis&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;SkipWorkItemCreation&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;true&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;SkipWorkItemCreation&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ContosoSolutionDir&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;c:\NightlyBuild\main\&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;ContosoSolutionDir&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ContosoSolutionName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;Contoso.sln&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;ContosoSolutionName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ContosoWSPName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;Contoso.Deployment.wsp&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;ContosoWSPName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ContosoDeploymentProjDir&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;c:\NightlyBuild\main\Contoso.Deployment\&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;ContosoDeploymentProjDir&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;IDEPath&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;IDEPath&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
  
  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ItemGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;SolutionToBuild&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Include&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildProjectFolderPath)/../../main/Contoso.sln"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;SolutionToBuild&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;ItemGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ItemGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ConfigurationToBuild&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Include&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Debug|Any CPU"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;FlavorToBuild&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;Debug&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;FlavorToBuild&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;PlatformToBuild&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;Any CPU&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;PlatformToBuild&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;ConfigurationToBuild&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;ItemGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Target&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Name&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="AfterCompile"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    
    &lt;SPAN class=rem&gt;&amp;lt;!-- The extensions modify files in the pkg directory, so those files cannot read only--&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Message&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Making the pkg directory editable."&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Output&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TaskParameter&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Id"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;PropertyName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="StepId"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Exec&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Command&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="attrib -R &amp;amp;quot;$(ContosoDeploymentProjDir)pkg\*.*&amp;amp;quot; /S /D"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Id&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(StepId)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Status&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Succeeded"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!-- Build using /package switch  --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Message&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Packaging wsp."&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Output&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TaskParameter&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Id"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;PropertyName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="StepId"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Exec&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Command&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="&amp;amp;quot;$(IDEPath)devenv&amp;amp;quot; &amp;amp;quot;$(ContosoSolutionDir)$(ContosoSolutionName)&amp;amp;quot; /Deploy debug /Package"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Id&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(StepId)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Status&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Succeeded"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!-- Copy package to drop folder --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Message&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Copying wsp to drop folder."&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Output&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TaskParameter&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Id"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;PropertyName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="StepId"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Copy&lt;/SPAN&gt; &lt;SPAN class=attr&gt;SourceFiles&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(ContosoDeploymentProjDir)bin\debug\$(ContosoWSPName)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;DestinationFolder&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(DropLocation)\$(BuildNumber)"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Copy&lt;/SPAN&gt; &lt;SPAN class=attr&gt;SourceFiles&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(ContosoDeploymentProjDir)bin\debug\setup.bat"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;DestinationFolder&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(DropLocation)\$(BuildNumber)"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Id&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(StepId)"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Status&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Succeeded"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;Target&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
  
&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;Project&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/STYLE&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9871609" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/TFS/default.aspx">TFS</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/msbuild/default.aspx">msbuild</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Team+Build/default.aspx">Team Build</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/VSEWSS+1.3/default.aspx">VSEWSS 1.3</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/visual+studio+extensions/default.aspx">visual studio extensions</category></item><item><title>Visual Studio Extensions for Windows SharePoint Services Error: System.ArgumentException, Value does not fall within the expected range</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/08/16/visual-studio-extensions-for-windows-sharepoint-services-error-system-argumentexception-value-does-not-fall-within-the-expected-range.aspx</link><pubDate>Sun, 16 Aug 2009 03:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9871313</guid><dc:creator>johnwpowell</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9871313.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9871313</wfw:commentRss><description>&lt;P&gt;A common error you may encounter when using VSEWSS 1.3 is “System.ArgumentException, Value does not fall within the specified range.”&amp;nbsp; This post outlines the common causes and resolutions for the issue.&amp;nbsp; 
&lt;P&gt;One suggestion I have seen on the web is to delete the pkg directory since it is auto-generated each time.&amp;nbsp; &lt;STRONG&gt;It is important that you do not do this&lt;/STRONG&gt;, because some information about the solution and features is stored in files in the pkg directory.&amp;nbsp; In fact, when doing team development with VSEWSS, the pkg directory must be included in the project and source control so other developers can properly package the solution.&amp;nbsp; 
&lt;P&gt;The following outlines the common causes and resolutions: 
&lt;H3&gt;Remove ASP.NET Web Sites from the Solution&lt;/H3&gt;
&lt;P&gt;In the VSEWSS 1.3 &lt;A href="http://download.microsoft.com/download/1/5/9/159A8BEA-E0BB-4CF6-8024-9CF764697393/VSeWSS%201%203%20Mar%202009%20CTP%20Release%20Notes.rtf" target=_blank mce_href="http://download.microsoft.com/download/1/5/9/159A8BEA-E0BB-4CF6-8024-9CF764697393/VSeWSS%201%203%20Mar%202009%20CTP%20Release%20Notes.rtf"&gt;release notes&lt;/A&gt;, there is a known issue: “You may receive the error “Value does not fall within the expected range.” When deploying a SharePoint solution that also contains an ASP.NET Web Project.”&amp;nbsp; The resolution is to “use a separate Visual Studio solution for each of the ASP.NET and SharePoint projects.”&amp;nbsp; If you need a web project, use a web application project instead of a web site.&lt;/P&gt;
&lt;H3&gt;Ensure Files Added as a Link Were Not Moved, Renamed or Deleted&lt;/H3&gt;
&lt;P&gt;The most common cause for the ArgumentException is that a file referenced in manifest or rootfiles is missing.&amp;nbsp; One of the things I like to do is develop in a separate projects and link items into the deployment project.&amp;nbsp; This allows me to use a web application project and test changes without having to deploy them to SharePoint first.&amp;nbsp; The downside of linking files is that the links aren’t updated if the source file is moved, renamed or deleted.&amp;nbsp; For example, consider the following project where I have an image file to deploy.&amp;nbsp; Note the shortcut icon indicates the image was added as a link: 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_10.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_10.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_thumb_4.png" width=231 height=257 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_thumb_4.png"&gt;&lt;/A&gt; 
&lt;P&gt;If I rename the source file in the Contoso.Web project to “pageerr.gif,” VSEWSS packaging will fail because the file is referenced in the manifest and rootfiles, but cannot be found: 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_12.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_12.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_thumb_5.png" width=228 height=259 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_thumb_5.png"&gt;&lt;/A&gt; 
&lt;P&gt;To resolve the issue, look for linked files that have a exclamation icon (which can be difficult to see) and re-link them. 
&lt;H3&gt;Verify your Installation is not Corrupt&lt;/H3&gt;
&lt;P&gt;This is the least likely cause, but I experienced this one time.&amp;nbsp; To test your installation, create a new SharePoint project using the Empty template.&amp;nbsp; Package the solution from the solution view.&amp;nbsp; Switch to the wsp view and refresh.&amp;nbsp; If there is something wrong with your installation, you will see a message like this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/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=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_thumb.png" width=665 height=177 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/VisualStudioExtensionsforWindowsSharePoi_96DF/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;To fix the issue, uninstall the extensions, &lt;A href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=fb9d4b85-da2a-432e-91fb-d505199c49f6" target=_blank mce_href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=fb9d4b85-da2a-432e-91fb-d505199c49f6"&gt;download the latest version of the extensions&lt;/A&gt;, and re-install.&amp;nbsp; Re-test creating an empty project.&lt;/P&gt;
&lt;H3&gt;Conclusion&lt;/H3&gt;
&lt;P&gt;The Visual Studio Extensions for Windows SharePoint Services can substantially increase your SharePoint development productivity.&amp;nbsp; However, when things go wrong, the extensions can be a productivity killer.&amp;nbsp; The error messages often do not contain enough detail to identify the cause and solution.&amp;nbsp; I hope this post saves you many hours of troubleshooting when you receive an ArgumentException. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9871313" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/VSEWSS+1.3/default.aspx">VSEWSS 1.3</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/visual+studio+extensions/default.aspx">visual studio extensions</category></item><item><title>Automate SharePoint Solution Builds with Visual Studio Extensions For Windows SharePoint Services (VSEWSS) 1.3</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/06/21/automate-sharepoint-solution-builds-with-visual-studio-extensions-for-windows-sharepoint-services-vsewss-1-3.aspx</link><pubDate>Mon, 22 Jun 2009 00:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9796334</guid><dc:creator>johnwpowell</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9796334.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9796334</wfw:commentRss><description>&lt;P&gt;In this walkthrough, I’ll demonstrate how to achieve automated builds and continuous integration by creating a build script for VSEWSS 1.3 solutions.&amp;nbsp; The &lt;A href="http://spg.codeplex.com/" target=_blank mce_href="http://spg.codeplex.com/"&gt;patterns and practices SharePoint Guidance&lt;/A&gt;&amp;nbsp; (11 drop) contains an example build script that this article is based on, but I found some issues with it in practice that I’d like to share.&amp;nbsp; Before we get started, I’d like to talk about the design of the extensions and some of the problems you may encounter with them.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;VSEWSS 1.3 stores information used to build the wsp file in a directory named “pkg” that is &lt;EM&gt;not&lt;/EM&gt; included in the project.&amp;nbsp; This works fine for individual development on a single machine, but not so well for team development and build automation.&amp;nbsp; The pkg directory must be manually included in the project so files needed to build the wsp are included in source control.&amp;nbsp; If you forget to do this, your teammates won’t be able to build the wsp, and you risk losing deployment configuration.&amp;nbsp; Furthermore, if you later add a new feature, you also have manually add the new feature subdirectory to the project.&amp;nbsp; In addition to storing configuration information, the pkg directory is also where solution files (feature.xml for example) are automatically generated.&amp;nbsp; When you package the wsp (or refresh in the wsp view), the files in the pkg directory must be checked out to be re-generated.&amp;nbsp; This also causes problems on the build server because the files in the pkg directory are read-only because they are checked into source control.&amp;nbsp; An improved design would be to store wsp configuration information in a folder/file that is part of the project and use the pkg directory &lt;EM&gt;only&lt;/EM&gt; for generating packages based on the wsp configuration files.&amp;nbsp; So now that you are aware of some of the team development “gotchas” with VSEWSS 1.3, I’ll show you, step-by-step, how to configure automated builds.&lt;/P&gt;
&lt;P&gt;If you just want to see the build script, &lt;A href="http://cid-7cedcb8ed3a44629.skydrive.live.com/self.aspx/Public/TFSBuild.proj" target=_blank mce_href="http://cid-7cedcb8ed3a44629.skydrive.live.com/self.aspx/Public/TFSBuild.proj"&gt;get it here&lt;/A&gt;.&amp;nbsp; &lt;STRONG&gt;Update: get a simplified build script &lt;/STRONG&gt;&lt;A href="http://blogs.msdn.com/johnwpowell/archive/2009/08/16/a-simple-build-script-for-packaging-visual-studio-extensions-for-windows-sharepoint-services-vsewss-1-3-projects-with-team-build.aspx" target=_blank mce_href="http://blogs.msdn.com/johnwpowell/archive/2009/08/16/a-simple-build-script-for-packaging-visual-studio-extensions-for-windows-sharepoint-services-vsewss-1-3-projects-with-team-build.aspx"&gt;&lt;STRONG&gt;here&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you have not installed TFS Build, you will need to install it using the TFS installation media.&amp;nbsp; You will also need to configure a service account such as &lt;EM&gt;TFSBuild&lt;/EM&gt;, and add the account to the TFS server group &lt;EM&gt;Team Foundation Licensed Users&lt;/EM&gt; and the Team Project(s) group &lt;EM&gt;Build Services&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;To get started, configure the build agent.&amp;nbsp; In the team project select &lt;EM&gt;Builds&lt;/EM&gt; &amp;gt; &lt;EM&gt;Manage Build Agents…&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/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="Manage Build Agents" border=0 alt="Manage Build Agents" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image_thumb.png" width=257 height=186 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Enter the build agent properties for your build server&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image3.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image3.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Build Agent Properties" border=0 alt="Build Agent Properties" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image3_thumb.png" width=434 height=399 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image3_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Create a new build definition by selecting &lt;EM&gt;Builds&lt;/EM&gt; &amp;gt; &lt;EM&gt;New Build Definition…&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image6%5B1%5D.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image6%5B1%5D.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="New Build Definition" border=0 alt="New Build Definition" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image6%5B1%5D_thumb.png" width=240 height=180 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image6%5B1%5D_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Enter a name for the build definition&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image12.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image12.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Build Definition General" border=0 alt="Build Definition General" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image12_thumb.png" width=600 height=400 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image12_thumb.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Configure the workspace.&amp;nbsp; Note: all files in the source control folder will be downloaded to the local folder you specify, so be sure the location you specify has enough free space&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image43.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image43.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Build Definition Workspace" border=0 alt="Build Definition Workspace" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image43_thumb.png" width=600 height=400 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image43_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Create the project file (TFSBuild.proj) by selecting the version control folder where you want it stored and selecting &lt;EM&gt;Create…&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image18.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image18.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Build Definition Project File" border=0 alt="Build Definition Project File" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image18_thumb.png" width=600 height=400 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image18_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Select the Visual Studio solution to build and click &lt;EM&gt;Next&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image21.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image21.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="MSBuild Project File Creation Wizard Selections" border=0 alt="MSBuild Project File Creation Wizard Selections" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image21_thumb.png" width=633 height=480 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image21_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Select the configuration(s) to build and click &lt;EM&gt;Next&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image24.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image24.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="MSBuild Project File Creation Wizard Configurations" border=0 alt="MSBuild Project File Creation Wizard Configurations" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image24_thumb.png" width=633 height=480 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image24_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;If you want to run unit tests or code analysis during the build, configure it and click &lt;EM&gt;Finish&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image27.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image27.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="MSBuild Project File Creation Wizard Options" border=0 alt="MSBuild Project File Creation Wizard Options" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image27_thumb.png" width=633 height=480 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image27_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Now that the project file is created, click &lt;EM&gt;OK&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image30.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image30.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Build Definition Project File" border=0 alt="Build Definition Project File" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image30_thumb.png" width=600 height=400 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image30_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Configure how many builds you would like to retain and click &lt;EM&gt;OK&lt;/EM&gt;.&amp;nbsp; Note: you should at least keep the latest of failed or partially succeeded builds or the build log file you need to troubleshoot will be deleted&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image33.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image33.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Build Definition Retention Policy" border=0 alt="Build Definition Retention Policy" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image33_thumb.png" width=600 height=400 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image33_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Enter a share where the build files will be dropped and click &lt;EM&gt;OK&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image36.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image36.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Build Definition Defaults" border=0 alt="Build Definition Defaults" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image36_thumb.png" width=600 height=400 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image36_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Configure what triggers the build, either manually, on a schedule or when files are checked in (continuous integration)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image39.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image39.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Build Definition Trigger" border=0 alt="Build Definition Trigger" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image39_thumb.png" width=600 height=400 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image39_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Test the build by highlighting the build definition and selecting &lt;EM&gt;Queue New Build…&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image46.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image46.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Queue New Build" border=0 alt="Queue New Build" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image46_thumb.png" width=258 height=210 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image46_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Click &lt;EM&gt;Queue&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image49.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image49.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Queue Build" border=0 alt="Queue Build" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image49_thumb.png" width=370 height=431 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image49_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;At this point you should have a working build, but it doesn’t package the wsp file yet&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image52.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image52.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Build Results" border=0 alt="Build Results" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image52_thumb.png" width=525 height=566 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image52_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Next, we’ll modify the build script to package the wsp file.&amp;nbsp; The build steps are as follows:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Clean up any workspaces / files left by the previous build packaging 
&lt;LI&gt;Build the Visual Studio solution 
&lt;LI&gt;Delete the workspace that was created by the build 
&lt;LI&gt;Create a workspace for the wsp packaging build 
&lt;LI&gt;Open a second instance of the IDE and package the solution using the /package switch 
&lt;LI&gt;Copy the wsp to the drop folder&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;In addition to this process, a nice to have is to display the packaging steps in the GUI, so we’ll use the BuildStep task to accomplish that&lt;/P&gt;
&lt;P&gt;To get started, get the latest version of the Team Build Types folder&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image1.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image1.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Get Latest Version Team Build Types" border=0 alt="Get Latest Version Team Build Types" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image1_thumb.png" width=349 height=120 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image1_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Check out the TFSBuild.proj file.&amp;nbsp; Note: when developing the build script, you will have to check it out to work on it, and check it back in to test it&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image4.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image4.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Check Out TFSBuild.proj" border=0 alt="Check Out TFSBuild.proj" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image4_thumb.png" width=356 height=113 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ba178f93efba_BDC1/image4_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Add the custom tasks used by the build.&amp;nbsp; Although we could accomplish what we need to using TF commands, these tasks are installed with TFS and work well&lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Project&lt;/SPAN&gt; &lt;SPAN class=attr&gt;DefaultTargets&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="DesktopBuild"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;xmlns&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="http://schemas.microsoft.com/developer/msbuild/2003"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;ToolsVersion&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="3.5"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class=rem&gt;&amp;lt;!-- These tasks are used by the Team Build process defined in this file --&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;UsingTask&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TaskName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Microsoft.TeamFoundation.Build.Tasks.DeleteWorkspaceTask"&lt;/SPAN&gt;
           &lt;SPAN class=attr&gt;AssemblyFile&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamBuildRefPath)\Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;UsingTask&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TaskName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Microsoft.TeamFoundation.Build.Tasks.CreateWorkspaceTask"&lt;/SPAN&gt;
             &lt;SPAN class=attr&gt;AssemblyFile&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamBuildRefPath)\Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Add the variables needed for wsp packaging.&amp;nbsp; Note: there is probably a better way to determine the location of the IDE&lt;/P&gt;&lt;PRE class=csharpcode&gt;  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!--  &lt;/SPAN&gt;
&lt;SPAN class=rem&gt;    Variables added for VSeWSS 1.3 builds &lt;/SPAN&gt;
&lt;SPAN class=rem&gt;    --&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!--  IDEPath&lt;/SPAN&gt;
&lt;SPAN class=rem&gt;    The path in which DevEnv and TF reside &lt;/SPAN&gt;
&lt;SPAN class=rem&gt;    --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;IDEPath&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;IDEPath&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!-- TempWorkspaceName&lt;/SPAN&gt;
&lt;SPAN class=rem&gt;    Workspace name, must not match an existing namespace name &lt;/SPAN&gt;
&lt;SPAN class=rem&gt;    --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;TempWorkspaceName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;NightlyBuildTempWorkspace&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;TempWorkspaceName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    
  &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;.csharpcode {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	MARGIN: 0em
}
.csharpcode .rem {
	COLOR: #008000
}
.csharpcode .kwrd {
	COLOR: #0000ff
}
.csharpcode .str {
	COLOR: #006080
}
.csharpcode .op {
	COLOR: #0000c0
}
.csharpcode .preproc {
	COLOR: #cc6633
}
.csharpcode .asp {
	BACKGROUND-COLOR: #ffff00
}
.csharpcode .html {
	COLOR: #800000
}
.csharpcode .attr {
	COLOR: #ff0000
}
.csharpcode .alt {
	BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; WIDTH: 100%
}
.csharpcode .lnum {
	COLOR: #606060
}
&lt;/STYLE&gt;

&lt;P&gt;Add the solution to build.&amp;nbsp; Note: this will build the binaries, but will not generate the wsp file&lt;/P&gt;&lt;PRE class=csharpcode&gt;  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ItemGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;SolutionToBuild&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Include&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildProjectFolderPath)/../../Intranet/Intranet.sln"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Targets&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;Targets&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Properties&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;Properties&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;SolutionToBuild&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;ItemGroup&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;.csharpcode {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	MARGIN: 0em
}
.csharpcode .rem {
	COLOR: #008000
}
.csharpcode .kwrd {
	COLOR: #0000ff
}
.csharpcode .str {
	COLOR: #006080
}
.csharpcode .op {
	COLOR: #0000c0
}
.csharpcode .preproc {
	COLOR: #cc6633
}
.csharpcode .asp {
	BACKGROUND-COLOR: #ffff00
}
.csharpcode .html {
	COLOR: #800000
}
.csharpcode .attr {
	COLOR: #ff0000
}
.csharpcode .alt {
	BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; WIDTH: 100%
}
.csharpcode .lnum {
	COLOR: #606060
}
&lt;/STYLE&gt;

&lt;P&gt;Add the target to clean up any files left by the previous build packaging (if the previous build failed or was cancelled).&amp;nbsp; This target is called during the build just before the workspace is created to build the solution&lt;/P&gt;&lt;PRE class=csharpcode&gt;  &lt;SPAN class=rem&gt;&amp;lt;!-- Before the build workpace is initialized --&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Target&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Name&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="BeforeInitializeWorkspace"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!-- Delete temporary workspace (if left by previous build) --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;Message&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Deleting temporary workspace &amp;amp;quot;$(TempWorkspaceName)&amp;amp;quot; (if left by previous build)."&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Output&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TaskParameter&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Id"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;PropertyName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="StepId"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;DeleteWorkspaceTask&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;Name&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TempWorkspaceName)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;DeleteLocalItems&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="true"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;DeleteWorkspaceTask&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;Name&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TempWorkspaceName)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;DeleteLocalItems&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="false"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;Id&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(StepId)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;Status&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Succeeded"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!-- Error Occurred --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;OnError&lt;/SPAN&gt; &lt;SPAN class=attr&gt;ExecuteTargets&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="MarkBuildStepAsFailed"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;Target&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;.csharpcode {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	MARGIN: 0em
}
.csharpcode .rem {
	COLOR: #008000
}
.csharpcode .kwrd {
	COLOR: #0000ff
}
.csharpcode .str {
	COLOR: #006080
}
.csharpcode .op {
	COLOR: #0000c0
}
.csharpcode .preproc {
	COLOR: #cc6633
}
.csharpcode .asp {
	BACKGROUND-COLOR: #ffff00
}
.csharpcode .html {
	COLOR: #800000
}
.csharpcode .attr {
	COLOR: #ff0000
}
.csharpcode .alt {
	BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; WIDTH: 100%
}
.csharpcode .lnum {
	COLOR: #606060
}
&lt;/STYLE&gt;

&lt;P&gt;Add the error handling target.&amp;nbsp; If any of the other steps fail, they will call this target using ExecuteTargets&lt;/P&gt;&lt;PRE class=csharpcode&gt;    &lt;SPAN class=rem&gt;&amp;lt;!-- Handles custom errors --&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Target&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Name&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="MarkBuildStepAsFailed"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;Id&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(StepId)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;Status&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Failed"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;Target&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;.csharpcode {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	MARGIN: 0em
}
.csharpcode .rem {
	COLOR: #008000
}
.csharpcode .kwrd {
	COLOR: #0000ff
}
.csharpcode .str {
	COLOR: #006080
}
.csharpcode .op {
	COLOR: #0000c0
}
.csharpcode .preproc {
	COLOR: #cc6633
}
.csharpcode .asp {
	BACKGROUND-COLOR: #ffff00
}
.csharpcode .html {
	COLOR: #800000
}
.csharpcode .attr {
	COLOR: #ff0000
}
.csharpcode .alt {
	BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; WIDTH: 100%
}
.csharpcode .lnum {
	COLOR: #606060
}
&lt;/STYLE&gt;

&lt;P&gt;In the AfterCompile target, add the step to delete the workspace that was automatically created by the build&lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=rem&gt;&amp;lt;!-- After the solutions are compiled --&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Target&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Name&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="AfterCompile"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!-- Delete build workspace --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
            &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
            &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
            &lt;SPAN class=attr&gt;Message&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Deleting build workspace &amp;amp;quot;$(WorkspaceName)&amp;amp;quot;."&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Output&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TaskParameter&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Id"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;PropertyName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="StepId"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;DeleteWorkspaceTask&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;Name&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(WorkspaceName)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;DeleteLocalItems&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="false"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;Id&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(StepId)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;Status&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Succeeded"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=rem&gt;&amp;lt;!-- END Delete build workspace --&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;.csharpcode {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	MARGIN: 0em
}
.csharpcode .rem {
	COLOR: #008000
}
.csharpcode .kwrd {
	COLOR: #0000ff
}
.csharpcode .str {
	COLOR: #006080
}
.csharpcode .op {
	COLOR: #0000c0
}
.csharpcode .preproc {
	COLOR: #cc6633
}
.csharpcode .asp {
	BACKGROUND-COLOR: #ffff00
}
.csharpcode .html {
	COLOR: #800000
}
.csharpcode .attr {
	COLOR: #ff0000
}
.csharpcode .alt {
	BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; WIDTH: 100%
}
.csharpcode .lnum {
	COLOR: #606060
}
&lt;/STYLE&gt;

&lt;P&gt;Just below that, add the build step to create the temporary workspace&lt;/P&gt;&lt;PRE class=csharpcode&gt;    &lt;SPAN class=rem&gt;&amp;lt;!-- Create temporary workspace --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;Message&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Creating temporary workspace &amp;amp;quot;$(TempWorkspaceName)&amp;amp;quot;."&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Output&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TaskParameter&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Id"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;PropertyName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="StepId"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;CreateWorkspaceTask&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;BuildDirectory&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildDirectory)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;SourcesDirectory&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(SolutionRoot)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;Name&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TempWorkspaceName)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;Comment&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Temporary workspace"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;CreateWorkspaceTask&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;Id&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(StepId)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;Status&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Succeeded"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=rem&gt;&amp;lt;!-- END Create temporary workspace --&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Add the step to package the solution.&amp;nbsp; This first marks all files in the pkg directory as not read only--the packaging will not be able to overwrite these files otherwise.&amp;nbsp; Then it runs the IDE and uses the /package switch to generate the wsp.&amp;nbsp; Finally, it copies the wsp to the drop folder.&amp;nbsp; If you had multiple wsp files to build, you could repeat the steps below or refactor into a target&lt;/P&gt;&lt;PRE class=csharpcode&gt;    &lt;SPAN class=rem&gt;&amp;lt;!-- Place projects to package here --&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!--  Build and package solution --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;Message&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Packaging &amp;amp;quot; Contoso Intranet solution&amp;amp;quot;."&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Output&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TaskParameter&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Id"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;PropertyName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="StepId"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!-- The extensions modify files in the pkg directory, so those files cannot read only--&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Exec&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Command&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="attrib -R &amp;amp;quot;$(BuildDirectory)\Contoso\Intranet\Deployment\pkg\*.*&amp;amp;quot; /S /D"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!-- Open a second instance of the dev environment and build using /package switch  --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Exec&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Command&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="&amp;amp;quot;$(IDEPath)\devenv&amp;amp;quot; &amp;amp;quot;$(BuildDirectory)\Contoso\Intranet\Intranet.sln&amp;amp;quot; /deploy debug /package"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=rem&gt;&amp;lt;!-- Copy to drop location --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Exec&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Command&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="xcopy &amp;amp;quot;$(BuildDirectory)\Contoso\Intranet\Deployment\bin\debug\Contoso.Intranet.wsp&amp;amp;quot; &amp;amp;quot;$(DropLocation)\$(BuildNumber)\&amp;amp;quot; /E /Y /R"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;Id&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(StepId)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;Status&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Succeeded"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=rem&gt;&amp;lt;!-- END Build and package solution --&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;.csharpcode {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	MARGIN: 0em
}
.csharpcode .rem {
	COLOR: #008000
}
.csharpcode .kwrd {
	COLOR: #0000ff
}
.csharpcode .str {
	COLOR: #006080
}
.csharpcode .op {
	COLOR: #0000c0
}
.csharpcode .preproc {
	COLOR: #cc6633
}
.csharpcode .asp {
	BACKGROUND-COLOR: #ffff00
}
.csharpcode .html {
	COLOR: #800000
}
.csharpcode .attr {
	COLOR: #ff0000
}
.csharpcode .alt {
	BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; WIDTH: 100%
}
.csharpcode .lnum {
	COLOR: #606060
}
&lt;/STYLE&gt;

&lt;P&gt;Add the build step to delete the temporary workspace we created&lt;/P&gt;&lt;PRE class=csharpcode&gt;    &lt;SPAN class=rem&gt;&amp;lt;!-- Delete temporary workspace --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
        &lt;SPAN class=attr&gt;Message&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Deleting temporary workspace &amp;amp;quot;$(TempWorkspaceName)&amp;amp;quot;."&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Output&lt;/SPAN&gt; &lt;SPAN class=attr&gt;TaskParameter&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Id"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;PropertyName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="StepId"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;

    
    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;DeleteWorkspaceTask&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;Name&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TempWorkspaceName)"&lt;/SPAN&gt;
          &lt;SPAN class=attr&gt;DeleteLocalItems&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="false"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;BuildStep&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;TeamFoundationServerUrl&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(TeamFoundationServerUrl)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;BuildUri&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(BuildUri)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;Id&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(StepId)"&lt;/SPAN&gt;
              &lt;SPAN class=attr&gt;Status&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Succeeded"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=rem&gt;&amp;lt;!-- END Delete temporary workspace --&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;.csharpcode {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	BACKGROUND-COLOR: #ffffff; FONT-FAMILY: consolas, "Courier New", courier, monospace; COLOR: black; FONT-SIZE: small
}
.csharpcode PRE {
	MARGIN: 0em
}
.csharpcode .rem {
	COLOR: #008000
}
.csharpcode .kwrd {
	COLOR: #0000ff
}
.csharpcode .str {
	COLOR: #006080
}
.csharpcode .op {
	COLOR: #0000c0
}
.csharpcode .preproc {
	COLOR: #cc6633
}
.csharpcode .asp {
	BACKGROUND-COLOR: #ffff00
}
.csharpcode .html {
	COLOR: #800000
}
.csharpcode .attr {
	COLOR: #ff0000
}
.csharpcode .alt {
	BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; WIDTH: 100%
}
.csharpcode .lnum {
	COLOR: #606060
}
&lt;/STYLE&gt;

&lt;P&gt;Check the project back in to source control, and queue the build to test it&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9796334" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/TFS/default.aspx">TFS</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/msbuild/default.aspx">msbuild</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/VSEWSS+1.3/default.aspx">VSEWSS 1.3</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/visual+studio+extensions/default.aspx">visual studio extensions</category></item><item><title>RV-AIR: A Five-Step Process to Troubleshoot and Fix Just About Anything</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/06/01/rv-air-a-five-step-process-to-troubleshoot-and-fix-just-about-anything.aspx</link><pubDate>Mon, 01 Jun 2009 02:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9672383</guid><dc:creator>johnwpowell</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9672383.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9672383</wfw:commentRss><description>&lt;P&gt;Effective troubleshooting is an important skill not only in the information technology field, but in many other professions.&amp;nbsp; Auto mechanics, electricians, counselors and doctors are essentially professional troubleshooters.&amp;nbsp; They identify problems, theorize solutions from their knowledge and experience, and systematically test them whether they be a new alternator or a prescription for high blood pressure medication.&amp;nbsp; I’m not a doctor, but being a good troubleshooter makes me feel like one.&amp;nbsp; In this article, I’ll share an age-old process for troubleshooting, “RV-AIR,” that was taught to me as an electronics engineer in the armed forces.&amp;nbsp; &lt;/P&gt;
&lt;H3&gt;Recognize&lt;/H3&gt;
&lt;P&gt;The first step of effective troubleshooting is to &lt;EM&gt;recognize&lt;/EM&gt; that a problem exists.&amp;nbsp; Obvious, yet often ignored, problem recognition is the single most important troubleshooting step.&amp;nbsp; That’s because the way in which we discover a problem impacts how we fix it, and can be the difference between treating the symptoms and curing the “disease.”&amp;nbsp; Problem recognition can be categorized as &lt;EM&gt;reactive&lt;/EM&gt; or &lt;EM&gt;proactive, &lt;/EM&gt;and describes our capability on a continuum from immature to mature respectively.&amp;nbsp; Reactive recognition is discovering a problem only when someone reports it.&amp;nbsp; Some might call this “fire fighting.”&amp;nbsp; When we are in a reactive state, we don’t know when or from where the next problem will arise, and the time we spend “putting out fires” takes us away from what we want, or need, to work on.&amp;nbsp; On the other end of the spectrum is proactive recognition in which problems are identified as soon as or &lt;EM&gt;before&lt;/EM&gt; they occur.&amp;nbsp; Using the doctor-patient analogy, proactive recognition is a preventative checkup that identifies high blood pressure and prevents a heart attack, and reactive recognition is discovering high blood pressure after having the heart-attack.&amp;nbsp; For software systems, proactive recognition is a health monitoring solution such as Microsoft System Center Operations Manager, but the key concepts of proactive maintenance and health monitoring transcend systems and disciplines.&lt;/P&gt;
&lt;H3&gt;Verify&lt;/H3&gt;
&lt;P&gt;Once a problem has been reported either by a person or a system, the next step is to &lt;EM&gt;verify&lt;/EM&gt; it.&amp;nbsp; It is very difficult to troubleshoot a problem that cannot be reproduced, and it is equally frustrating to waste time troubleshooting something that was never broken in the first place.&amp;nbsp; As much as we like our customers, the PEBKAC (Problem Exists Between Keyboard and Chair) factor applies.&amp;nbsp; I’m not saying that user’s are stupid, but experience dictates that you should trust your customers, but not their problem reports.&amp;nbsp; Let me illustrate this point with an example.&amp;nbsp; Your newly licensed teenage daughter calls you in a blind panic that the expensive car you lent her won’t go into gear.&amp;nbsp; What could be wrong?&amp;nbsp; You begin theorizing, “maybe she ran over something,” “maybe when I got my fluid changed, they didn’t put the plug back in.“&amp;nbsp; Then you jump to a diagnosis and a decision, “The transmission is broken, so I better call a tow truck and make an appointment at the dealership.”&amp;nbsp; You have the car towed to the shop and spend hundreds of dollars to discover that nothing is wrong; your daughter simply forgot to press the brake pedal before putting it into gear!&amp;nbsp; The moral of the story is that problem verification saves time, money &lt;EM&gt;and&lt;/EM&gt; relationships. &lt;/P&gt;
&lt;H3&gt;Analyze&lt;/H3&gt;
&lt;P&gt;After a problem has been recognized and verified, the next step is to &lt;EM&gt;analyze &lt;/EM&gt;it.&amp;nbsp; During this step, the symptoms of the problem are analyzed and a set of possible causes, or &lt;EM&gt;theories&lt;/EM&gt;, are identified.&amp;nbsp; The result is a ranked list of potential solutions that will be systematically proved or disproved in the next step.&amp;nbsp; Knowledge and experience plays a large role in how you arrive at your theories and the more troubleshooting you do, the better you will get at it.&amp;nbsp; Strive&amp;nbsp; to identify root causes and permanent solutions.&amp;nbsp; Leverage the experience of others by thoroughly researching the problem &lt;EM&gt;on your own first&lt;/EM&gt; before asking others.&amp;nbsp; Effective troubleshooters are effective researchers, and they know where to look, how to filter out noise and identify useful nuggets of information.&amp;nbsp; From your research and analysis, you will have a list, at least in your head, of the potential causes.&amp;nbsp; Rank the causes from most to least likely and identify a solution for each.&lt;/P&gt;
&lt;H3&gt;Isolate&lt;/H3&gt;
&lt;P&gt;After analyzing the problem and identifying the most likely causes and solutions, the &lt;EM&gt;isolate&lt;/EM&gt; step is a systematic process of elimination.&amp;nbsp; For each of your theories, from most to least probable, test the solution in a non-production environment (if possible) so that you don’t introduce new problems.&amp;nbsp; Go slow and apply only one change before each test.&amp;nbsp; Beware of false positives and validate the root problem is solved and not just the symptoms.&amp;nbsp; If you are unable to find a solution, then you may need to collect additional data and return to analysis.&amp;nbsp; Once you find a solution, the next step is to create a plan for applying the fix. &lt;/P&gt;
&lt;H3&gt;Repair&lt;/H3&gt;
&lt;P&gt;The final troubleshooting step is to permanently &lt;EM&gt;repair&lt;/EM&gt; the problem by applying the solution identified in the isolate step.&amp;nbsp; &lt;/P&gt;
&lt;H3&gt;Conclusion&lt;/H3&gt;
&lt;P&gt;RV-AIR is a proven process for finding and fixing problems and is equally effective for tracking down a memory leak as it is for finding a shorted electrical outlet in your house.&amp;nbsp; The key to effective troubleshooting is to recognize, verify, analyze, isolate and repair.&amp;nbsp; Happy troubleshooting!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9672383" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/.Net/default.aspx">.Net</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Debugging/default.aspx">Debugging</category></item><item><title>Make the RSS Feed Viewer Web Part Dynamic Using Filters and Web Part Connections</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/03/01/bind-the-rss-feed-viewer-to-multiple-feeds-using-filters-and-web-part-connections.aspx</link><pubDate>Sun, 01 Mar 2009 19:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9452738</guid><dc:creator>johnwpowell</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9452738.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9452738</wfw:commentRss><description>&lt;P&gt;One of the shortcomings of the RSS Viewer web part is that it can only be bound one feed.&amp;nbsp; In this walkthrough, I’ll show you how to make the RSS Viewer web part dynamic with filter web parts and web part connections to enable binding to multiple feeds.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Create the RSS Feeds List&lt;/H3&gt;
&lt;P&gt;In &lt;EM&gt;View All Site Content&lt;/EM&gt;, select &lt;EM&gt;Create&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_4.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_4.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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_1.png" width=181 height=74 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Select Custom List and enter a name such as “RSS Feeds.”&amp;nbsp; Next, add two columns to the list.&amp;nbsp; The first column will hold the feed URL and the second column is a one-line description of the feed that will be displayed in the filter list.&amp;nbsp; Name the column “Feed URL,” set the type to &lt;EM&gt;Single line of text&lt;/EM&gt; (not Hyperlink), make it required, and add it to the default view.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_6.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_2.png" width=616 height=141 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Add the description column.&amp;nbsp; Name the column “Feed Description,” set the type to &lt;EM&gt;Single line of text&lt;/EM&gt;, make it required, and add it to the default view.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_10.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_10.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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_4.png" width=616 height=142 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_4.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, add some feeds to the list:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_12.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_12.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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_5.png" width=616 height=257 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_5.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Add an RSS Viewer Web Part&lt;/H3&gt;
&lt;P&gt;Add an RSS Viewer web part to a page:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_16.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_16.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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_7.png" width=594 height=465 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_7.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Configure the web part to default to your favorite feed:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_18.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_18.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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_8.png" width=194 height=98 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_8.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;
&lt;H3&gt;Add a Filter Web Part&lt;/H3&gt;
&lt;P&gt;Add a filter web part to the page to control which feed is displayed in the RSS Viewer.&amp;nbsp; Add a SharePoint List Filter web part to the page:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/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=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb.png" width=570 height=470 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Configure the filter web part to use the values from the feed list:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_20.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_20.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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_9.png" width=248 height=332 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_9.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;
&lt;H3&gt;Connect the Filter Web Part to the RSS Viewer Web Part&lt;/H3&gt;
&lt;P&gt;Next, connect the filter web part to the RSS viewer web part.&amp;nbsp; Select Connections &amp;gt; Send Filter Values To &amp;gt; RSS Viewer:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_24.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_24.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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_11.png" width=616 height=170 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_11.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Set the &lt;EM&gt;Connection Type&lt;/EM&gt; to “Get Feed URL From”:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_26.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_26.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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_12.png" width=466 height=235 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_12.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;
&lt;H3&gt;Test the Filter&lt;/H3&gt;
&lt;P&gt;Click the browse button on the filter:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_30.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_30.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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_14.png" width=414 height=54 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_14.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Select one of the feeds and the corresponding feed should display in the RSS Viewer:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_28.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_28.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/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_13.png" width=394 height=314 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/95bbbaf8ec46_8D6F/image_thumb_13.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Conclusion&lt;/H3&gt;
&lt;P&gt;The RSS Viewer web part can be made more dynamic and provide a better user experience by using filter web parts.&amp;nbsp; In this walkthrough I showed you one type of filter, but I invite you to investigate other approaches using some of the other out of the box filter web parts.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;References and Additional Reading&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A title="RSS Feed Reader (CodePlex)" href="http://feedreader.codeplex.com/" target=_blank mce_href="http://feedreader.codeplex.com/"&gt;RSS Feed Reader (CodePlex)&lt;/A&gt; 
&lt;LI&gt;&lt;A title="Work with Filter Web Parts" href="http://office.microsoft.com/en-us/sharepointserver/HA100337861033.aspx" target=_blank mce_href="http://office.microsoft.com/en-us/sharepointserver/HA100337861033.aspx"&gt;Work with Filter Web Parts&lt;/A&gt; 
&lt;LI&gt;&lt;A title="Issues using RSS Feed Viewer Web Part with a List of RSS Feeds using Sharepoint 2007" href="http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/be731b08-f25a-4ec6-959c-0af59df379c7/" target=_blank mce_href="http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/be731b08-f25a-4ec6-959c-0af59df379c7/"&gt;Issues using RSS Feed Viewer Web Part with a List of RSS Feeds using SharePoint 2007&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/markarend/archive/2006/10/03/RSS-Viewer-web-part-and-authenticated-feeds.aspx" target=_blank mce_href="http://blogs.msdn.com/markarend/archive/2006/10/03/RSS-Viewer-web-part-and-authenticated-feeds.aspx"&gt;RSS Viewer Web Part and Authenticated Feeds&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9452738" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/WSS3/default.aspx">WSS3</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category></item><item><title>Subscribe to SharePoint Web Parts using Internet Explorer 8 Web Slices</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/02/01/subscribe-to-sharepoint-web-parts-using-internet-explorer-8-web-slices.aspx</link><pubDate>Mon, 02 Feb 2009 00:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9388724</guid><dc:creator>johnwpowell</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9388724.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9388724</wfw:commentRss><description>&lt;P&gt;One of the new features of Internet Explorer 8 is &lt;EM&gt;Web Slices.&amp;nbsp; &lt;/EM&gt;This feature enables you to subscribe to a &lt;EM&gt;section&lt;/EM&gt; of a web page and notifies you when the content changes.&amp;nbsp; By design, SharePoint Web Parts are a natural fit for this feature, and in this article I’ll show you how to build a Web Part that does just that.&amp;nbsp; I’ll also show you how easy it is to develop a web part using the CTP release of Visual Studio 2008 Extensions for Windows SharePoint Services (VSSWse) 1.3.&lt;/P&gt;
&lt;H3&gt;About Web Slices&lt;/H3&gt;
&lt;P&gt;Web Slices enable you to have a very narrow control over the content you subscribe to.&amp;nbsp; When you browse a page that has Web Slice sections, they “light up” when you hover over them:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/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=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb.png" width=344 height=68 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In addition, the new Web Slice icon on the toolbar lights up, and the menu is populated with all the slices on the page:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_4.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_4.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/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_1.png" width=198 height=59 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_1.png"&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;When you subscribe to a slice, the web page section is added to the toolbar and is periodically refreshed.&amp;nbsp; The refresh interval is completely customizable and can also be refreshed manually:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_6.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/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/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_2.png" width=426 height=297 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_2.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Defining a Web Slice Section&lt;/H3&gt;
&lt;P&gt;Web Slices are defined with HTML tags that have certain CSS classes.&amp;nbsp; You can read the &lt;A href="http://msdn.microsoft.com/en-us/library/cc304073%28VS.85%29.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/cc304073%28VS.85%29.aspx"&gt;full specification&lt;/A&gt;, but here’s all you need to know to build your first Web Slice:&lt;/P&gt;
&lt;P&gt;To define a Web Slice section, use the &lt;EM&gt;hslice&lt;/EM&gt; class name:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;lt;div class="hslice" id="1"&amp;gt;…&amp;lt;/div&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;To define the slice title, use the &lt;EM&gt;entry-title&lt;/EM&gt; class name:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;lt;p class="entry-title"&amp;gt;Game System - $66.00&amp;lt;/p&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;To define the slice content, use the &lt;EM&gt;entry-content&lt;/EM&gt; class name:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;lt;div class="entry-content"&amp;gt;This auction closes in 4 hours.&amp;lt;/div&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The end result looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;&amp;lt;div class="hslice" id="1"&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p class="entry-title"&amp;gt;Game System - $66.00&amp;lt;/p&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class="entry-content"&amp;gt;This auction closes in 4 hours.&amp;lt;/div&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;lt;/div&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;H3&gt;Build a SharePoint Web Part&lt;/H3&gt;
&lt;P&gt;For this example, I’m using VSSWSE 1.3 which you can read about &lt;A href="http://blogs.msdn.com/sharepoint/archive/2009/01/12/announcing-community-technology-preview-of-visual-studio-2008-extensions-for-sharepoint-v1-3.aspx" target=_blank mce_href="http://blogs.msdn.com/sharepoint/archive/2009/01/12/announcing-community-technology-preview-of-visual-studio-2008-extensions-for-sharepoint-v1-3.aspx"&gt;here&lt;/A&gt;.&amp;nbsp; I would recommend it not only because it’s easy to use, but also because it is sure to become the de-facto standard.&amp;nbsp; To get started, create a new Web Part project:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_8.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_8.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/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_3.png" width=616 height=442 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_3.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Choose if you want to deploy to the GAC or bin directory.&amp;nbsp; We’ll use GAC for this example:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_10.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_10.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/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_4.png" width=362 height=215 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_4.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A solution is created with a default web part named WebPart1.&amp;nbsp; Rather than renaming it, delete the WebPart1 folder and add a new Web Part to the project with a more descriptive name:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_12.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_12.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/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_5.png" width=616 height=373 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_5.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Next, configure the url of your SharePoint site you want to use to test the Web Part.&amp;nbsp; On the Debug settings, set the start url:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_20.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_20.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_9.png" width=615 height=113 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_9.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In the Web Part, override the CreateChildControls method:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_16.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_16.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/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_7.png" width=616 height=363 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_7.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code generates the needed HTML and is pretty self-explanatory.&amp;nbsp; I chose to hide the Web Slice entry-title as it would be redundant beneath the Web Part title.&amp;nbsp; To test the code, right-click the solution or project and select Deploy.&amp;nbsp; This will package the Web Part as a feature and deploy and activate it on the site:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_22.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_22.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_10.png" width=392 height=169 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_10.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, add the Web Part to a page in the site and test it.&lt;/P&gt;
&lt;H3&gt;How I Wished It Worked&lt;/H3&gt;
&lt;P&gt;Web Slices are powerful, but I don’t really want to develop a bunch of new Web Parts to use that feature.&amp;nbsp; I wish every Web Part were capable of wrapping its content in a Web Slice div tag.&amp;nbsp; I’m sure there is a way to inject this functionality (and there might even be a supported method), but I wish it were built in to the Web Part framework.&amp;nbsp; Every Web Part could then have a Web Slice category with relevant settings:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_18.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_18.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/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_8.png" width=237 height=219 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_8.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Wouldn’t that be powerful?&lt;/P&gt;
&lt;H3&gt;Summary&lt;/H3&gt;
&lt;P&gt;In this article, I demonstrated how to build a Web Part that users can subscribe to using Web Slices.&amp;nbsp; I also showed you how easy it is to build a Web Part using the CTP release of Visual Studio 2008 Extensions for Windows SharePoint Services version 1.3.&amp;nbsp; Happy slicing!&lt;/P&gt;
&lt;H3&gt;References and Additional Reading&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/windows/internet-explorer/download-ie.aspx" target=_blank&gt;Internet Explorer 8 Download&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc196992(VS.85).aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/cc196992(VS.85).aspx"&gt;Subscribing to Content with Web Slices&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc304073%28VS.85%29.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/cc304073%28VS.85%29.aspx"&gt;Web Slice Format Specification&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=4A7F2178-DB7E-4325-98B5-15FA725708E2&amp;amp;displaylang=en" target=_blank mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=4A7F2178-DB7E-4325-98B5-15FA725708E2&amp;amp;displaylang=en"&gt;Web Slice Icon and Guidelines&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.microsoft.com/windows/internet-explorer/beta/videos.aspx?vindex=3" target=_blank mce_href="http://www.microsoft.com/windows/internet-explorer/beta/videos.aspx?vindex=3"&gt;Internet Explorer 8 Videos : Web Slices&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9388724" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/.Net/default.aspx">.Net</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/WSS/default.aspx">WSS</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/WSS3/default.aspx">WSS3</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Windows+SharePoint+Services/default.aspx">Windows SharePoint Services</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>How to Copy an Assembly From the GAC to the File System</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/01/14/how-to-copy-an-assembly-from-the-gac.aspx</link><pubDate>Wed, 14 Jan 2009 04:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9317728</guid><dc:creator>johnwpowell</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9317728.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9317728</wfw:commentRss><description>&lt;P&gt;Sometimes you need a local copy of an assembly from the GAC and here is a quick tip on how to do it.&amp;nbsp; The GAC can be found in the c:\windows\assembly directory, but if you try to browse it, the following custom shell extension appears:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_2.png"&gt;&lt;IMG height=462 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb.png" width=616 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;This view does not provide the ability to copy assemblies, but it does provide some very useful information such as the strong name details.&amp;nbsp; Here are some options to get around that feature to copy an assembly from the GAC.&lt;/P&gt;
&lt;H3&gt;Option 1: Disable the Shell Extension in the Registry&lt;/H3&gt;
&lt;P&gt;One possibility, but not the best one, is to disable the shell extension.&amp;nbsp; I don't like this approach because it involves editing the registry and I like the information provided by the shell extension.&amp;nbsp; Here's how to disable the extension if you want to.&amp;nbsp; Open the registry editor and add/set the HKLM\Software\Microsoft\Fusion\DisableCacheViewer DWORD value:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_4.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_4.png"&gt;&lt;IMG height=137 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_1.png" width=616 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Set the value to 1:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_6.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_6.png"&gt;&lt;IMG height=192 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_2.png" width=324 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Once you make that change, you can browse the directory:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_8.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_8.png"&gt;&lt;IMG height=231 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_3.png" width=616 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Option 2: Go Command-O&lt;/H3&gt;
&lt;P&gt;Another option is to copy assemblies from the GAC from the command line.&amp;nbsp; This approach works well if you prefer working from the command line, but if you like to right-click with a mouse, this might not be the choice for you. &lt;/P&gt;
&lt;P&gt;I highly recommend PowerShell, but you can use Windows Command Prompt.&amp;nbsp; Find your way to the c:\windows\assembly directory and copy the file you need:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_10.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_10.png"&gt;&lt;IMG height=141 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_4.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Option 3: Use the SUBST Command&lt;/H3&gt;
&lt;P&gt;The SUBST command allows you to create a shortcut to a path on your file system and assigns that shortcut a drive letter.&amp;nbsp; I really like this approach because you have the option of using Windows Explorer without having to disable the shell.&lt;/P&gt;
&lt;P&gt;Suppose you want to create a G Drive (G for GAC), use the following command: SUBST G: C:\WINDOWS\ASSEMBLY&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_12.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_12.png"&gt;&lt;IMG height=53 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_5.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_5.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Then in Windows Explorer you are free to double-click and right-click to your heart's content and still use the shell extension.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_14.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_14.png"&gt;&lt;IMG height=277 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_6.png" width=616 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCopyanAssemblyFromtheGAC_117F8/image_thumb_6.png"&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9317728" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/.Net/default.aspx">.Net</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/PowerShell/default.aspx">PowerShell</category></item><item><title>Consume SharePoint Web Services with WCF using the Repository, Gateway, Mapper, Domain Model and Factory Design Patterns</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/01/03/consume-sharepoint-web-services-with-wcf-using-the-repository-gateway-mapper-domain-model-and-factory-design-patterns.aspx</link><pubDate>Sun, 04 Jan 2009 00:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9270662</guid><dc:creator>johnwpowell</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9270662.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9270662</wfw:commentRss><description>&lt;P&gt;The SharePoint developer community has produced a wealth of knowledge and code samples that demonstrate how to consume SharePoint web services and leverage them in domain-specific applications.&amp;nbsp; This information is often task-centric, such as&amp;nbsp; "How to add an Item to a List using SharePoint Web Services."&amp;nbsp;&amp;nbsp; In this article, we will take a framework-centric approach and apply sound, fundamental object-oriented (OO) design principles to implement a reusable library for working with the SharePoint web services. &lt;/P&gt;
&lt;H3&gt;Motivation and Goals&lt;/H3&gt;
&lt;P&gt;My motivation for this article is to help you create a foundation for a framework that can be used in one, or reused across many SharePoint-integrated applications.&amp;nbsp; I also want to demonstrate how good software design principles can (and should) be applied to SharePoint development, and confess my own sins for not always following them.&amp;nbsp; For some reason, I often find myself thinking procedurally when developing a SharePoint customization.&amp;nbsp; Perhaps it's because the product is a 70% solution and requires a different mindset and approach than a large greenfield software project does.&amp;nbsp; Maybe customers expect results faster when you build it on SharePoint, and I've taken shortcuts to meet them.&amp;nbsp; Or maybe I've just been lazy, but in any case, here are some of the issues I've seen or been responsible for:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Re-writing the same SharePoint code on each new project 
&lt;LI&gt;Not refactoring within and across applications 
&lt;LI&gt;Tightly coupling application code to the XML input and output from SharePoint services 
&lt;LI&gt;Lack of a domain model; designing procedurally instead of applying domain-driven design (DDD) 
&lt;LI&gt;Not having well-defined layers and strategies 
&lt;LI&gt;Failure to design for testability and not writing unit tests&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Here are some of the goals I would like to achieve with this framework:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Implement a domain model that is independent and decoupled from the SharePoint services 
&lt;LI&gt;Define a set of patterns and strategies for communicating with the SharePoint services 
&lt;LI&gt;Create a reusable library that can be used in many different domain-specific applications 
&lt;LI&gt;Use DDD and Test-Driven-Design (TDD) 
&lt;LI&gt;Apply good OO principals and patterns 
&lt;LI&gt;Use Windows Communication Foundation (WCF)&lt;/LI&gt;&lt;/UL&gt;
&lt;H3&gt;Design&lt;/H3&gt;
&lt;P&gt;In the next section, I'll walk through the implementation and the process I went through to arrive at the design below.&amp;nbsp; Generally speaking, I used DDD and TDD (where it made sense) and followed the Single Responsibility principle.&amp;nbsp; If you are not familiar with this, it is often described as "a class should only have one reason to change."&amp;nbsp; I call it the "&lt;EM&gt;and&lt;/EM&gt; test."&amp;nbsp; I describe the purpose of the class and if I have to use the word &lt;EM&gt;and&lt;/EM&gt;, I consider refactoring some of the functionality to another class.&lt;/P&gt;
&lt;P&gt;In the diagram below, the client application uses the &lt;EM&gt;repository&lt;/EM&gt; and &lt;EM&gt;domain&lt;/EM&gt; classes.&amp;nbsp; The repository is responsible for retrieving domain objects based on criteria.&amp;nbsp; The repository uses one or more &lt;EM&gt;service gateways&lt;/EM&gt; to get the information it needs.&amp;nbsp; The service gateway communicates with the SharePoint web services using a WCF client.&amp;nbsp; The service calls typically return XML responses, and it is the job of the &lt;EM&gt;service response mapper&lt;/EM&gt; to translate the XML to a domain object.&amp;nbsp; Finally, the WCF client factory creates clients configured to call the SharePoint services.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://dmfyxa.blu.livefilestore.com/y1p-jNcgP6Mi2JH-RjylslbXH9lLohguNO84QYKIvH9IP0LvoRQWsD8WXagNh0BD6Jn9YrEzS_8nT0CkvxtsaCMTg/SharePointSamples.Patterns.zip?download" target=_blank mce_href="http://dmfyxa.blu.livefilestore.com/y1p-jNcgP6Mi2JH-RjylslbXH9lLohguNO84QYKIvH9IP0LvoRQWsD8WXagNh0BD6Jn9YrEzS_8nT0CkvxtsaCMTg/SharePointSamples.Patterns.zip?download"&gt;Get the code&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/SPServicePattern_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/SPServicePattern_2.png"&gt;&lt;IMG height=164 alt=SPServicePattern src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/SPServicePattern_thumb.png" width=616 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/SPServicePattern_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Implementation&lt;/H3&gt;
&lt;P&gt;In this example, the goal is to get all the lists in a given site.&amp;nbsp; Following DDD, we will start the design in the domain layer and create a list class that has a title property:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_2.png"&gt;&lt;IMG height=196 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb.png" width=440 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Create the list repository class to define the method clients will call the get the lists in a given site:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_8.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_8.png"&gt;&lt;IMG height=258 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_3.png" width=600 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Following TDD, we'll create a unit test that will fail until we implement the repository:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_22.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_22.png"&gt;&lt;IMG height=262 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_9.png" width=394 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_9.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Return to the repository class and add the implementation to call the lists service gateway which we haven't created yet.&amp;nbsp; How did I know to create a lists service gateway?&amp;nbsp; I decided to have a gateway that corresponds to each SharePoint web service and did some research to find the exact service and method that would return the lists for a given site.&amp;nbsp; The implementation below is very simple, but you can imagine a more complex repository that uses several service gateways and does some additional processing to construct a domain object graph.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_20.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_20.png"&gt;&lt;IMG height=264 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_8.png" width=571 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_8.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Create the lists service gateway so the project will compile:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_10.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_10.png"&gt;&lt;IMG height=275 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_4.png" width=606 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_4.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a failing unit test for the lists service gateway:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_18.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_18.png"&gt;&lt;IMG height=384 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_1.png" width=634 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_1.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Next we'll add a reference to the SharePoint Lists service.&amp;nbsp;&amp;nbsp; Note: Visual Studio will add an app.config and a Properties &amp;gt; DataSources folder and you can delete both of them.&amp;nbsp; We are going to configure WCF programmatically.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_16.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_16.png"&gt;&lt;IMG height=436 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_7.png" width=535 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_7.png"&gt;&lt;/A&gt;&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Return to the lists service gateway and fill in the implementation.&amp;nbsp; Now I'm pulling a "Julia Childs" on you.&amp;nbsp; I already went through several iterations of TDD and refactoring to arrive at the implementation below.&amp;nbsp; Initially this method had all the code to call the web service, and there was no WCF client factory nor a mapper.&amp;nbsp; After implementing this logic in several gateways, I refactored the commonality to classes.&amp;nbsp; It made sense to have a factory to construct WCF clients in a consistent way and allow me to make a change in one place if I discovered something new.&amp;nbsp; The Single Responsibility "&lt;EM&gt;and&lt;/EM&gt; test" led me to refactor the mapping code to a separate class and the end result is a much cleaner implementation:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_24.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_24.png"&gt;&lt;IMG height=327 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_10.png" width=621 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_10.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, we'll implement the WCF client factory.&amp;nbsp; As you can see, it has been through a few iterations of TDD and refactoring starting with the service url class.&amp;nbsp; This class contains constants and methods for working with SharePoint service urls.&amp;nbsp; The other thing you'll notice is the the WCF configuration that is typically done in a configuration file is being done programmatically in the service binding factory class.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_26.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_26.png"&gt;&lt;IMG height=381 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_11.png" width=835 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_11.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Here is the implementation of the service binding factory:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_28.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_28.png"&gt;&lt;IMG height=280 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_12.png" width=749 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_12.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The gateway uses a mapper to map the XML response from the SharePoint web service to a domain object.&amp;nbsp; The XML response is in the form of &amp;lt;element attribute1...n /&amp;gt; which, in this case, translates nicely to domain objects and properties.&amp;nbsp; The code below uses Linq to find all List elements and for each one it calls MapInternal which creates a list object from the element:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_30.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_30.png"&gt;&lt;IMG height=551 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_13.png" width=649 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_13.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Now if we return to the repository GetLists unit test, it passes and output each list title in the site:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_32.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_32.png"&gt;&lt;IMG height=270 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_14.png" width=402 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/ConsumeSharePointWebServiceswithWCFusing_D2A4/image_thumb_14.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Summary&lt;/H3&gt;
&lt;P&gt;In this article and walkthrough, I demonstrated how DDD, TDD, patterns and good OO principles can be applied to implement a framework that consumes SharePoint web services.&amp;nbsp; Even though I focused on the web services, the SharePoint API can also be regarded as a service and the same fundamentals can be applied to developing applications that run on the server.&amp;nbsp; I hope this inspires and helps you to implement your own framework and improve the quality and reuse of your SharePoint code.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://dmfyxa.blu.livefilestore.com/y1p-jNcgP6Mi2JH-RjylslbXH9lLohguNO84QYKIvH9IP0LvoRQWsD8WXagNh0BD6Jn9YrEzS_8nT0CkvxtsaCMTg/SharePointSamples.Patterns.zip?download" target=_blank mce_href="http://dmfyxa.blu.livefilestore.com/y1p-jNcgP6Mi2JH-RjylslbXH9lLohguNO84QYKIvH9IP0LvoRQWsD8WXagNh0BD6Jn9YrEzS_8nT0CkvxtsaCMTg/SharePointSamples.Patterns.zip?download"&gt;Get the code&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;References and Additional Reading&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://martinfowler.com/eaaCatalog/" target=_blank mce_href="http://martinfowler.com/eaaCatalog/"&gt;Catalog of Patterns of Enterprise Application Architecture&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.amazon.com/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1231018800&amp;amp;sr=8-1" target=_blank mce_href="http://www.amazon.com/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1231018800&amp;amp;sr=8-1"&gt;Patterns of Enterprise Application Architecture&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/magazine/cc546578.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/magazine/cc546578.aspx"&gt;Patterns in Practice: The Open Closed Principle&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9270662" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Pattern/default.aspx">Pattern</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Design+Pattern/default.aspx">Design Pattern</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/TDD/default.aspx">TDD</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/DDD/default.aspx">DDD</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+Web+Services/default.aspx">SharePoint Web Services</category></item><item><title>SharePoint Designer Copy List Item Workflow Activity Does Not Copy All Fields</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/01/02/sharepoint-designer-copy-list-item-workflow-activity-does-not-copy-all-fields.aspx</link><pubDate>Fri, 02 Jan 2009 19:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9269406</guid><dc:creator>johnwpowell</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9269406.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9269406</wfw:commentRss><description>&lt;P&gt;A common SharePoint customization request is to copy or move items and documents between lists.&amp;nbsp; This can be accomplished without development by creating a workflow using SharePoint Designer (SPD).&amp;nbsp; With this approach, you may encounter issues with list item fields not copying or copying intermittently.&amp;nbsp; This article will explain how the copy list item activity works, what can go wrong and how to troubleshoot and resolve the issues.&lt;/P&gt;
&lt;H3&gt;About SPD Workflows&lt;/H3&gt;
&lt;P&gt;If you are not familiar with SPD workflows, here is a quick primer on how to create a workflow that copies a list item to another list.&amp;nbsp; Open the site and select File &amp;gt; New Workflow.&amp;nbsp; Select the source list and set the start options.&amp;nbsp; Note in this example, the workflow executes when a new list item is added. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=484 alt="Define your new workflow" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb.png" width=620 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The workflow consists of steps which have conditions and actions.&amp;nbsp; In this example, there are no conditions, only an action to copy the list item:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_4.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_4.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=484 alt="Copy List Item Step" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_1.png" width=622 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Configure the action to copy the current item in the source list to the target list and click Finish to associate the workflow with the source list.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_6.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_6.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=484 alt="Configure Copy List Item Activity" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_2.png" width=620 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_2.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add a new item to the source list and you can see the outcome of the workflow:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_8.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_8.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=142 alt="Copy List Item Source" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_3.png" width=532 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The item was copied to the target list:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_10.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_10.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=134 alt="Copy List Item Target" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_4.png" width=533 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;How the Copy List Item Activity Works&lt;/H3&gt;
&lt;P&gt;The copy list item activity iterates through all the fields in the source list and tries to find a match in the target list.&amp;nbsp; The fields are considered compatible for copying when the following is true:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The source and target field names are the same.&amp;nbsp; It compares the field name you see in the browser (SPField.Title), not the internal/static name (SPField.InternalName) 
&lt;LI&gt;The source and target field are the same type 
&lt;LI&gt;The source and target fields are compatible.&amp;nbsp; For example, if the source field allows multiple selections, but the target does not, or the source allows selecting people and groups, but the target only allows selecting people 
&lt;LI&gt;When the source field is a lookup to another list, the target field must use the same list 
&lt;LI&gt;The source field is not read only 
&lt;LI&gt;The source field is not a special field, such as ContentTypeId&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;After the field matches have been determined, a list item is created in the target list using a system update (does not trigger event receivers / workflows and the created by user is &lt;EM&gt;system&lt;/EM&gt;).&amp;nbsp; In addition, when the field type is User, the user(s) are created in the target web if they don't already exist.&lt;/P&gt;
&lt;H3&gt;What Can Go Wrong&lt;/H3&gt;
&lt;P&gt;There are two common symptoms and the underlying causes of each is human error.&amp;nbsp; But don't beat yourself up; they are easy mistakes to make and correct.&amp;nbsp; Use the following to troubleshoot the issue:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;When a SPD workflow doesn't copy &lt;EM&gt;one&lt;/EM&gt; field to the target list: 
&lt;UL&gt;
&lt;LI&gt;The field names don't match 
&lt;LI&gt;The field names match, but the field type and the settings do not&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;In a &lt;EM&gt;document library&lt;/EM&gt;, when &lt;EM&gt;none&lt;/EM&gt; of the fields are copied (except the file name), or when all the fields are copied but &lt;EM&gt;intermittently&lt;/EM&gt;: 
&lt;UL&gt;
&lt;LI&gt;The issue is that everything is working as designed and the workflow hasn't accounted for it!&amp;nbsp; There is a difference between &lt;EM&gt;New&lt;/EM&gt; and &lt;EM&gt;Upload&lt;/EM&gt;&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;H3&gt;The Difference Between New and Upload in a Document Library&lt;/H3&gt;
&lt;P&gt;In a document library, users can add a document two ways through the browser.&amp;nbsp; The first option is to click &lt;EM&gt;New&lt;/EM&gt;.&amp;nbsp; This opens the client application associated to the list template such as Microsoft Word.&amp;nbsp; In Word 2007, the list item properties appear on the Document Information Panel (In Word 2003, the list item properties are displayed in a dialog when you save the document):&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_22.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_22.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=144 alt="Document Information Panel" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_10.png" width=509 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_10.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Because the list item properties are captured by the client application, the document and properties are saved at the same time.&amp;nbsp; The save triggers the workflow created event receiver logic and the copy will succeed.&amp;nbsp; When the document is added using the Upload (or Upload Mutliple) option, the upload occurs in two stages.&amp;nbsp; The first stage is adding the file to the document library:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_26.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_26.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=238 alt="Upload Document Stage 1" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_12.png" width=632 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_12.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The second stage is updating the list item properties.&amp;nbsp; At this point, the item has been added to the document library, the created event has fired, and the copy list item workflow has completed. The properties haven't been entered, so the workflow copied the document and blank property values to the target list.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_28.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_28.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=395 alt="Upload Document Stage 2" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_13.png" width=633 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointDesignerCopyListItemActivityDo_6A06/image_thumb_13.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The following summarizes the differences between &lt;EM&gt;New&lt;/EM&gt; and &lt;EM&gt;Upload&lt;/EM&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;When a document is uploaded using &lt;EM&gt;New&lt;/EM&gt;, &lt;STRONG&gt;there is only a create&lt;/STRONG&gt;&amp;nbsp; 
&lt;LI&gt;When a document is uploaded using &lt;EM&gt;Upload&lt;/EM&gt;, &lt;STRONG&gt;there is a create when the file is uploaded and an update when (and if) the properties are updated--but the properties are updated with a system update so the update event does not fire &lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;H3&gt;Troubleshooting and Solutions&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;When only &lt;EM&gt;one&lt;/EM&gt; field doesn't copy 
&lt;UL&gt;
&lt;LI&gt;Don't trust your eyes, copy the field name from the source list and paste it into the field name of the target list.&amp;nbsp; For example, how long does it take you to spot the difference between these two fields:&amp;nbsp; Source:Mutiline Field, Target:Multiline Field? 
&lt;LI&gt;Compare the settings between the source field and target field.&amp;nbsp; Does one allow multiple values and the other does not?&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;In a document library when all fields don't copy or copy intermittently 
&lt;UL&gt;
&lt;LI&gt;The workflow needs to account for the difference between &lt;EM&gt;New&lt;/EM&gt; and &lt;EM&gt;Upload&lt;/EM&gt; 
&lt;UL&gt;
&lt;LI&gt;Configure the workflow to execute when the item is changed 
&lt;LI&gt;Add a condition to the copy list item step to examine the workflow status&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;To overcome the issue with document libraries, one possible approach is to modify the SPD workflow as follows:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set the workflow to execute only when the item is created 
&lt;LI&gt;In the first step, add a wait activity to wait until a required field is not empty (a field that is entered in the "second&amp;nbsp; stage" after the document is uploaded)&lt;/LI&gt;&lt;/UL&gt;
&lt;H3&gt;Conclusion&lt;/H3&gt;
&lt;P&gt;SPD workflows are a business-user enabling technology and a useful tool in your SharePoint customization toolkit.&amp;nbsp; I hope this article sheds some light on how to implement a copy list item workflow using SPD and how to troubleshoot and resolve common issues with the approach.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9269406" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Workflow/default.aspx">Workflow</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Windows+Workflow+Foundation/default.aspx">Windows Workflow Foundation</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+Designer/default.aspx">SharePoint Designer</category></item><item><title>Enterprise Content Management: What it is and Why You Need It</title><link>http://blogs.msdn.com/johnwpowell/archive/2008/11/04/enterprise-content-management-what-it-is-and-why-you-need-it.aspx</link><pubDate>Tue, 04 Nov 2008 03:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9036241</guid><dc:creator>johnwpowell</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9036241.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9036241</wfw:commentRss><description>&lt;P&gt;If you were to survey corporate America on how it defines an enterprise content management (ECM) system, the majority response would be a software tool primarily used by large organizations to create and publish Web content. This article challenges that definition and proposes that ECM is a process that may or may not be supplemented with software tools. In addition, the scope of ECM extends to organizations of all sizes and beyond public Web content to any leverageable informational asset that an enterprise creates, publishes, consumes, and archives. &lt;/P&gt;
&lt;P&gt;Before delving into ECM, we must answer two fundamental questions: w&lt;I&gt;hat is enterprise content&lt;/I&gt; and &lt;I&gt;why do we need to manage it&lt;/I&gt;? In the broadest sense, enterprise content is an informational asset owned by an enterprise. An article on the corporate Web page is but one drop in the enterprise’s content portfolio bucket, which includes content that is not traditionally managed by ECM software such as strategic plans, proposals, lessons learned, marketing slicks, images, whitepapers, and case studies. If you have ever heard (or asked) the question, “Where is the ______ we did for _____,” you are already down the path to understanding &lt;I&gt;why&lt;/I&gt; we need to manage enterprise content. &lt;/P&gt;
&lt;P&gt;There are many practical reasons for managing content such as controlling what is published and who can see it, but the fundamental reason is to enable an enterprise to leverage what it “knows,” and more importantly to be able to “know what it knows.” Although the topic of Knowledge Management (KM) is outside the scope of this article, the transfer of knowledge to content and content to knowledge is the overarching concept behind why ECM should be a key component of all enterprises. &lt;/P&gt;
&lt;P&gt;The term, “ECM,” is associated with software tools and is typically reserved for medium to large companies due to the significant investment required. But if you expand the context of ECM to be a process that is supplemented by tools, it becomes apparent that enterprises of all sizes already have a system for managing content, formalized or not. Running the gamut from the “wild, wild west” of ECM to highly structured processes backed by automation, the information produced and consumed by these systems is the lifeblood of any organization. &lt;/P&gt;
&lt;P&gt;Although there is no right or wrong ECM methodology, there are best practices for content management that can be built upon. “Right” is only measured by how well the system meets the needs of its organization. These needs should be understood before investing in a software tool. It is also critical to have a commitment from key decision makers to improve how information is managed and leveraged continuously. Although it may prove challenging to obtain this commitment, there is a strong case for ECM. By leveraging what it knows, an enterprise can use its experience as a foundation, rather than continually paying others to re-do work from scratch. Not leveraging what you know is like sending monthly payments to the bank when the loan is paid in full—that defies common sense. &lt;/P&gt;
&lt;P&gt;The first step toward improving the process of managing information assets in your organization is being able to measure the health of your ECM portfolio against a set of goals. No single set of requirements, or one software tool will meet the needs of all enterprises. Each must establish its own goals, gather requirements, analyze alternatives, and choose between buying and building a tool. &lt;/P&gt;
&lt;P&gt;An ECM system exists to facilitate the flow of information throughout the organization. Think of the ECM system as plumbing and information as water flowing through it. Do the pipes in your organization have leaks, bottlenecks or valves that make it difficult for authors to publish content and consumers to find it? Do some departments dig their own information wells and isolate themselves from the enterprise information supply? Analogies aside, a healthy ECM system is one that is an integral part of the business and enables the unrestricted flow of information throughout the enterprise. &lt;/P&gt;
&lt;P&gt;Bottlenecks typically occur in the Publish phase of the ECM lifecycle. Authors create content and often encounter an information technology (IT) bottleneck when they attempt to share it with the organization, its partners or customers. This bottleneck results in frustration for the author, increased workload and resource requirements on IT, and reduces the motivation to share information. People have a job to do, and if the ECM system hinders that job, they will avoid or go around it. This results in numerous information wells across the enterprise and cripples information sharing and knowledge transfer. Bottlenecks are not just isolated to IT; however, and can be caused by many factors notwithstanding complexity, bureaucracy, and inefficient processes. &lt;/P&gt;
&lt;P&gt;We have established that the flow of information is the overarching goal of a healthy ECM system, but we can dissect that goal into key health indicators found in each phase of the ECM lifecycle. Enterprise content moves through five phases during its lifetime: Create, Describe, Publish, Consume and Archive. The following indicators are not meant as requirements for procuring an automated system, but rather are observable points of a healthy ECM system, automated or not. Using these indicators you can establish measurable goals and embark on an ECM improvement process. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Create&lt;/I&gt;&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;Everyone in your organization has information to share, and the ECM system should facilitate, and encourage this. Treating everyone as a contributor enables people to “give back” and results in communities of interest and a continuous information feedback loop. If only a few can contribute, the content could become biased or narrowly focused. With the ECM open to a diverse author population, content creation must be simple. Authors should be able to work in familiar tools. If it is too complex to create content for the ECM system, the organization will not achieve a balanced perspective on given areas and many people simply won’t share information at all. &lt;/P&gt;
&lt;P&gt;Key indicators found in the Create phase are: &lt;/P&gt;
&lt;UL type=circle&gt;
&lt;LI&gt;
&lt;P&gt;Everyone is a potential contributor and should have the ability to author and submit content &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Authors should be able to work in familiar tools. The ECM system shouldn’t preclude the author from using their word processor with features such as spelling and grammar checking or force someone to compose a lengthy whitepaper in a text box on a web page &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Content creation must be simple. If the process is complex or requires technical intervention, people will be reluctant to share information &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Describe&lt;/I&gt;&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;Before publishing and sharing content or perhaps even before composing it, the author is aware of certain attributes such as its subject and intended audience. These attributes are referred to as &lt;I&gt;metadata&lt;/I&gt; or &lt;I&gt;facets&lt;/I&gt;, and enable information consumers to find what they are looking for by browsing or searching. The ECM system must have a strong content typing mechanism that enables information architects to design content types, their facets and associated validation rules. To provide a concrete example, suppose an organization frequently produces case studies and whitepapers about project management. The ECM system would define a &lt;I&gt;case study&lt;/I&gt; and a &lt;I&gt;whitepaper&lt;/I&gt; content type. The whitepaper type could have facets such as &lt;I&gt;project management lifecycle&lt;/I&gt; and &lt;I&gt;target experience level&lt;/I&gt; whereas the case study type might have &lt;I&gt;industry&lt;/I&gt; and &lt;I&gt;company name&lt;/I&gt;. In addition, ECM systems should enforce validation rules to maintain the integrity and consistency of the metadata. &lt;/P&gt;
&lt;P&gt;Humans have an innate need to bring order out of chaos. In nature, we categorize by genus and species, and in a brick and mortar library, books are shelved by topic. This organization by category and subcategory is referred to as taxonomy. In traditional library classification schemes such as the Dewey Decimal System, each piece of content has a "correct" place in a hierarchically organized classification system, but there needn’t be a “correct” single-faceted taxonomy. Without the limitations imposed by physical storage, automated ECM systems can dynamically generate multi-faceted taxonomies enabling information to be classified by a series of facets. This enables information consumers to categorize content in a manner that is meaningful to them. &lt;/P&gt;
&lt;P&gt;In addition to classifying content by facets, ECM systems should enable authors and content managers to relate content with other content. By creating these relationships, information consumers can be led to other relevant information and take them down paths they may not have anticipated. Automated systems can discover relationships between by analyzing usage, identifying patterns and making recommendations. Most of us are familiar with cross-selling techniques such as “you might also be interested in this,” or “people who purchased this also purchased this.” ECM systems should do with content what retailers do with products. The payoff is in worker productivity and intellectual capital. &lt;/P&gt;
&lt;P&gt;Key indicators found in the Describe phase are: &lt;/P&gt;
&lt;UL type=circle&gt;
&lt;LI&gt;
&lt;P&gt;The ability to define content types and associated facets and validation rules &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Support for both static and dynamic information taxonomies &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Association of relevant content &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Publish&lt;/I&gt;&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;Once content has been created and described, the next phase involves sharing it with all or part of the organization. The Publish phase is a checkpoint that controls what is published and who can see it. With everyone in your organization as a potential contributor and sensitive information to protect, the ECM system must enforce the publication process. Without process, the ECM system could become a dumping ground rather than a knowledge repository. We use the term &lt;I&gt;workflow&lt;/I&gt; to describe the steps that must be taken to publish content. A basic workflow could be: &lt;/P&gt;
&lt;UL type=circle&gt;
&lt;LI&gt;
&lt;P&gt;Author submits content for approval &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Content manager reviews content and approves or rejects it &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Content is published &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The workflow will be different at each organization, and the ECM system should include a flexible mechanism that supports custom workflows. &lt;/P&gt;
&lt;P&gt;In addition to controlling the publication process, determining and specifying security requirements is another major step in the Publish phase. This can be accomplished a number of ways, but automated ECM systems typically use role-based security. Each role has a specific set of rights which could include such permissions as “View,” “Edit,” “Delete,” or “Approve.” The ideal ECM system enables roles to be set at the facet or content section level. With this type of granular security, a team could collaborate on a proposal and each person could only view and modify the sections and metadata they are responsible for. The security mechanism should also be flexible to include employees, customers, partners and even anonymous users. &lt;/P&gt;
&lt;P&gt;Versioning is an important aspect of the Publication phase. The ECM system should enable the option to store multiple versions of a given content item, but only the approved published version should be available for consumption. There are two types of content versioning: &lt;/P&gt;
&lt;UL type=circle&gt;
&lt;LI&gt;
&lt;P&gt;Publication versioning &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Historical versioning &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Publication versioning is the ability to have a single content item with two versions, the version currently being edited and the published version. This type of versioning is an essential feature of an ECM system and prevents the modification of published content while still enabling it to be developed. Modified content should go through a workflow and upon approval, become the published version. Historical versioning is the ability to keep a historical record of changes to content over time. When enabled, this type of versioning should allow content managers to view or rollback to a previous version. &lt;/P&gt;
&lt;P&gt;Key indicators found in the Publish phase are: &lt;/P&gt;
&lt;UL type=circle&gt;
&lt;LI&gt;
&lt;P&gt;Customizable workflow to control what is published &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Security mechanism that controls permissions to information &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Support for publication versioning and the ability to enable historical versioning &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Consume&lt;/I&gt;&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;The Consume phase has both the longest duration and the most importance to the organization. Through this phase, personal knowledge becomes shared knowledge, and the single most important function of the ECM system is to support this. What would be the sense of gathering, describing and publishing content it if information consumers are unable to find it? To understand the role of the ECM system during this phase, let’s examine how consumers go about locating information. &lt;/P&gt;
&lt;P&gt;The methods by which consumers locate information can be divided into the following categories: &lt;/P&gt;
&lt;UL type=circle&gt;
&lt;LI&gt;
&lt;P&gt;&lt;I&gt;Intentional&lt;/I&gt; : ask an expert, searching, browsing &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;&lt;I&gt;Incidental&lt;/I&gt; : during an intentional effort, another path to the information presents itself &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;&lt;I&gt;Accidental&lt;/I&gt; : the information is found purely by chance in a way that could not have been predicted &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Arguably the top way in which people locate information is to find someone who is regarded to them or by the organization as a subject matter expert. This approach works well in small organizations, but in larger or disparate organizations it is simply not effective. The ECM system does not have the answers to all questions and should enable consumers to locate and communicate with experts. Experts can be self-identified or nominated based off some objective criteria such as participation in working groups, prior experience or current position. If someone executes an intentional search for “Project Management,” the ECM system should not only return whitepapers and case studies, but also people with expert knowledge.&lt;/P&gt;
&lt;P&gt;Searching is a pervasive method of locating information, and should be one of the largest investment areas in the ECM system. Information consumers should be able to execute a basic keyword search and be presented with results. In addition to keyword searches, the ECM system should have an advanced search mechanism based around the content types and facets described in the Describe phase. In other words, consumers should be able to make a request such as “show me all case studies where the sector is &lt;I&gt;Public&lt;/I&gt; and the customer is &lt;I&gt;Department of Homeland Security&lt;/I&gt;. ” Finally, the search should include a learning mechanism that analyzes search patterns and improves future search results. &lt;/P&gt;
&lt;P&gt;In addition to asking an expert and searching, consumers also browse to locate information. The ECM system should provide features to support this, and one mechanism is a &lt;I&gt;Library View&lt;/I&gt;. A library view can be thought of as a virtual bookshelf and presents a single information taxonomy. Examples of a library view can be seen at &lt;A href="http://msdn.microsoft.com/library/" target=_blank mce_href="http://msdn.microsoft.com/library/"&gt;http://msdn.microsoft.com/library/ &lt;/A&gt;and &lt;A href="http://www.pmboulevard.com/Library.aspx" target=_blank mce_href="http://www.pmboulevard.com/Library.aspx"&gt;http://www.pmboulevard.com/Library.aspx &lt;/A&gt;. Because there is no single correct taxonomy, the ideal ECM should enable consumers to dynamically generate multi-faceted library views such as “show me templates organized by sector then customer then project management lifecycle.” &lt;/P&gt;
&lt;P&gt;Incidental information location happens when a user intentionally sets out to locate information and another path to the information presents itself. This type of information discovery is often overlooked, but is an essential function of an ECM system through related content, targeting, personalization and recommendations. When consuming content, users should be presented with related content which can also include files and other supplements to the main body of information. Targeting is the matching of content facets to user facets. One example of targeting might be Virginia-based employees seeing a message on the corporate intranet that North Carolina-based employees do not. Information consumers can also locate information incidentally through recommendations that include such things as “this week’s most popular articles,” and “people who were interested in this were also interested in this.” &lt;/P&gt;
&lt;P&gt;Consumers may also find information by accident. This does not mean it was purely by chance, however. The user may not have been expecting to find information there, but though the ECM system, its content managers made a conscious decision in content placement. By highlighting content in a newsletter or a featured location on a web page, users may find themselves reading an article they currently have no interest in, but equips them for a future endeavor. The ECM system should facilitate accidental information location by enabling content managers to feature content and control its placement. &lt;/P&gt;
&lt;P&gt;Key indicators found in the Consume phase are: &lt;/P&gt;
&lt;UL type=circle&gt;
&lt;LI&gt;
&lt;P&gt;Support for intentional, incidental and accidental location of information &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Ability to identify and locate subject matter experts &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Basic and advanced search &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Library views &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Related content &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Targeting and recommendations &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Ability to feature and control content placement &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Enable information consumers to provide feedback &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Archive&lt;/I&gt;&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;The last phase of the ECM lifecycle is content disposition. All content has a lifespan of relevance, timelessness and usefulness and the ECM should archive content beyond its “sell by date.” During the Publish phase, content managers should be able to specify the publication end date, and in this case archival should be automatic. For other content, both objective and subjective decisions must be made to archive. &lt;/P&gt;
&lt;P&gt;The ECM system should assist content managers in determining what to archive or destroy. The system should provide usage analysis to identify unused content. In addition, by enabling information consumers to provide feedback about its usefulness, content can either be updated or archived. &lt;/P&gt;
&lt;P&gt;Key indicators found in the Archive phase are: &lt;/P&gt;
&lt;UL type=circle&gt;
&lt;LI&gt;
&lt;P&gt;Provide usage statistics to recommend content for archival &lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Enable content managers to make archival decisions based on information consumer feedback &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Conclusion&lt;/I&gt;&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;By leveraging ECM, organizations can facilitate the transformation of personal information to shared information and tacit knowledge to explicit knowledge. By “knowing what it knows,” an enterprise can use experience as a foundation, rather than continually re-doing and re-learning on each task. Hopefully this series on ECM has imparted the importance of managing content at your organization and that content and ultimately knowledge management is a continuous improvement process. By understanding the ECM lifecycle and the attributes of a healthy system, you should be inspired to set goals and undertake an ECM improvement process in your organization. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9036241" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/ECM/default.aspx">ECM</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Content+Management/default.aspx">Content Management</category></item><item><title>Build PowerShell CmdLets to call SharePoint Web Services using WCF</title><link>http://blogs.msdn.com/johnwpowell/archive/2008/11/02/build-powershell-cmdlets-to-call-sharepoint-web-services-using-wcf.aspx</link><pubDate>Mon, 03 Nov 2008 00:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9029678</guid><dc:creator>johnwpowell</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9029678.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9029678</wfw:commentRss><description>&lt;P&gt;In this post I'll show you how to build a PowerShell cmdlet that consumes SharePoint web services using WCF.&amp;nbsp; What I like about this approach is that it provides the ability to use &lt;EM&gt;some&lt;/EM&gt; of the SharePoint API without having to be logged in to the SharePoint server.&amp;nbsp; Although you can accomplish the same thing using PowerShell scripts and functions, in this post we'll build a SharePoint cmdlet using C#.&amp;nbsp; &lt;/P&gt;
&lt;H3&gt;About the Approach&lt;/H3&gt;
&lt;P&gt;There are several advantages of combining PowerShell and SharePoint web services:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Consume the SharePoint API without logging on to a SharePoint server 
&lt;LI&gt;Provide a layer of abstraction and reusable task-oriented building blocks 
&lt;LI&gt;Reduce risk of performance issues caused by PowerShell scripts that don't dispose of unmanaged SharePoint resources&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;There are also some drawbacks to writing custom cmdlets that consume SharePoint web services:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;SharePoint web services do not expose the full API; you may need to augment them with business-specific functionality 
&lt;LI&gt;Cmdlets require compilation and additional overhead over script file&lt;/LI&gt;&lt;/UL&gt;
&lt;H3&gt;Getting Started&lt;/H3&gt;
&lt;P&gt;In this walkthrough, I'm using Visual Studio 2008 on a SharePoint virtual machine.&amp;nbsp; Although you &lt;EM&gt;could&lt;/EM&gt; use a Visual Studio PowerShell project template, we'll are going to build everything by hand so there are no mysteries.&amp;nbsp; So let's get started by creating a new class library project:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_2.png"&gt;&lt;IMG height=163 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb.png" width=240 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add a reference to PowerShell which is contained in System.Management.Automation assembly.&amp;nbsp; If you've installed the Windows SDK, you can find it in the following location: C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image3.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image3.png"&gt;&lt;IMG height=197 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image3_thumb.png" width=240 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image3_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Since we are creating a class that will both describe and install a custom snap in, we need to reference System.Configuration.Install&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image9.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image9.png"&gt;&lt;IMG height=197 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image9_thumb.png" width=240 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image9_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Create the Snap In and Cmdlet&lt;/H3&gt;
&lt;P&gt;Add a new class that inherits CustomPSSnapIn.&amp;nbsp; Add the RunInstaller attribute to the class and describe the snap in by overriding the Name, Vendor and Description properties.&amp;nbsp; Your code should end up looking like this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image12.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image12.png"&gt;&lt;IMG height=783 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image12_thumb.png" width=515 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image12_thumb.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add a new class that inherits from Cmdlet.&amp;nbsp; We'll build a cmdlet to get information about a SharePoint site, so name it "GetSPWebCmdlet."&amp;nbsp; Add the Cmdlet attribute to the class. You'll notice the cmdlet name, "Get-SPWeb" is a combination of the noun string &lt;EM&gt;SPWeb&lt;/EM&gt; and verb enumeration &lt;EM&gt;VerbsCommon.Get&lt;/EM&gt; specified by the Cmdlet attribute:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image18.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image18.png"&gt;&lt;IMG height=289 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image18_thumb.png" width=386 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image18_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Override the Cmdlets property in the snap in class and add the Get-SPWeb cmdlet to the Cmdlets collection:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image21.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image21.png"&gt;&lt;IMG height=231 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image21_thumb.png" width=805 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image21_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Configure Visual Studio to Install and Add the Snap In When the Project is Debugged&lt;/H3&gt;
&lt;P&gt;Before we add any code to the cmdlet, let's configure Visual Studio to automatically deploy the snap in to make debugging easier.&amp;nbsp; We'll use a post-build event to install the snap in, so in the spirit of learning PowerShell, we'll write the post-build script in PowerShell!&amp;nbsp; Add a new text file to your project named PostBuildEvent.ps1.&amp;nbsp; Add the following script to the file:&lt;/P&gt;
&lt;P&gt;trap &lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp; $errorTxt = $_.Exception.Message&lt;BR&gt;&amp;nbsp;&amp;nbsp; write-output "$errorTxt"&lt;BR&gt;&amp;nbsp;&amp;nbsp; break&lt;BR&gt;} 
&lt;P&gt;$targetDir = $args[0]&lt;BR&gt;$targetFileName = $args[1]&lt;BR&gt;$snapInName = $args[2] 
&lt;P&gt;write-output "Deploying..."&lt;BR&gt;join-path $targetDir $targetFileName&lt;BR&gt;write-output "Snap In Name: $snapInName" 
&lt;P&gt;set-location $targetDir&lt;BR&gt;set-alias installutil $env:windir\Microsoft.NET\Framework\v2.0.50727\installutil&lt;BR&gt;installutil $targetFileName 
&lt;P&gt;Notice the script file takes some arguments (targetDir, targetFileName and snapInName).&amp;nbsp; Using that information, it installs the SnapIn (and our SharePoint cmdlet).&amp;nbsp; Configure Visual Studio to pass the arguments to the post-build event:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image27.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image27.png"&gt;&lt;IMG height=235 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image27_thumb.png" width=422 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image27_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;After a SnapIn is installed, you have to add it to your environment before it can be used.&amp;nbsp; As you can see, even though our custom snap in has been installed, it is not listed when you call &lt;EM&gt;Get-PSSnapin&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_20.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_20.png"&gt;&lt;IMG height=212 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_7.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_7.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;To add it, call &lt;EM&gt;Add-PSSnapin&lt;/EM&gt; passing in the name of the assembly:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_22.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_22.png"&gt;&lt;IMG height=158 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_9.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_9.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;We don't want to add the snap in after each code change, so we are going to automate it by adding a console file that will add the snap in into our environment when the project is debugged.&amp;nbsp; Add a new file named SharePointSamples.Console.psc1 to your project.&amp;nbsp; Put the following xml in the file:&lt;/P&gt;
&lt;P&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;BR&gt;&amp;lt;PSConsoleFile ConsoleSchemaVersion="1.0"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;PSVersion&amp;gt;1.0&amp;lt;/PSVersion&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;PSSnapIns&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PSSnapIn Name="SharePointSamples.PowerShell" /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/PSSnapIns&amp;gt;&lt;BR&gt;&amp;lt;/PSConsoleFile&amp;gt; 
&lt;P&gt;In the project configuration, Debug settings, configure Visual Studio to start PowerShell when you debug and in the command-line arguments section, use the -PSConsoleFile argument to specify the console file you created:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_16.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_16.png"&gt;&lt;IMG height=316 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_2.png" width=499 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Implement the Cmdlet&lt;/H3&gt;
&lt;P&gt;Now that deployment and debugging are taken care of, add the following code to the cmdlet:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_24.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_24.png"&gt;&lt;IMG height=568 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_10.png" width=711 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_10.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The cmdlet takes the url of the site as an argument.&amp;nbsp; Arguments are implemented as class properties decorated with the &lt;EM&gt;Parameter&lt;/EM&gt; attribute.&amp;nbsp; The work is implemented in the &lt;EM&gt;ProcessRecord&lt;/EM&gt; method.&amp;nbsp; As you can see, I already did some re-factoring and created a service locator class that will give me an instance of the SharePoint &lt;EM&gt;Webs&lt;/EM&gt; service (using WCF).&amp;nbsp; The code then invokes the &lt;EM&gt;GetWeb&lt;/EM&gt; method and writes out the resulting xml.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Here is the code for the service locator.&amp;nbsp; As you can see it configures the SharePoint Webs proxy: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_28.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_28.png"&gt;&lt;IMG height=324 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_12.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_12.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Most of the key WCF configuration settings for integrated authentication are implemented in the BindingFactory class:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_30.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_30.png"&gt;&lt;IMG height=311 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_13.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_13.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;H3&gt;Test the Cmdlet&lt;/H3&gt;
&lt;P&gt;To test the cmdlet, run the project.&amp;nbsp; When the PowerShell command prompt opens, type &lt;EM&gt;Get-SPWeb&lt;/EM&gt;.&amp;nbsp; You will be prompted for the site url if you don't provide it:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_26.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_26.png"&gt;&lt;IMG height=217 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_11.png" width=505 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/d480dd7087aa_8548/image_thumb_11.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Summary&lt;/H3&gt;
&lt;P&gt;In this walkthrough, you learned how to leverage PowerShell, WCF and the SharePoint web services to implement a custom cmdlet.&amp;nbsp; Using this approach, you can expand the administrative capabilities of SharePoint and build reusable, task-oriented building blocks to increase your productivity and capability.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://cid-7cedcb8ed3a44629.skydrive.live.com/self.aspx/Public/SharePointSamples.zip" target=_blank mce_href="http://cid-7cedcb8ed3a44629.skydrive.live.com/self.aspx/Public/SharePointSamples.zip"&gt;Get the code&lt;/A&gt; for this article.&lt;/P&gt;
&lt;H3&gt;Additional Reading&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.capdes.com/2007/03/visual_studio_post_build_event.html" target=_blank mce_href="http://www.capdes.com/2007/03/visual_studio_post_build_event.html"&gt;Visual Studio Build Events With PowerShell&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.wrox.com/WileyCDA/Section/id-320555.html" target=_blank mce_href="http://www.wrox.com/WileyCDA/Section/id-320555.html"&gt;Extending Windows Powershell with Snap-ins&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?List=90bbfd11-c9a5-45cf-a77e-19559aae81ae&amp;amp;ID=7" target=_blank mce_href="http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?List=90bbfd11-c9a5-45cf-a77e-19559aae81ae&amp;amp;ID=7"&gt;Managing SharePoint with PowerShell&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://cglessner.blogspot.com/2008/06/powershell-sharepoint.html" target=_blank mce_href="http://cglessner.blogspot.com/2008/06/powershell-sharepoint.html"&gt;PowerShell &amp;amp; SharePoint - Quick Start&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://darrinbishop.com/blog/archive/2007/04/08/54.aspx" target=_blank mce_href="http://darrinbishop.com/blog/archive/2007/04/08/54.aspx"&gt;SharePoint and PowerShell Demo&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.trentswanson.com/post/2008/01/Calling-SharePoint-web-services-using-Visual-Studio-20082c-WCF2c-and-Windows-Auth.aspx" target=_blank mce_href="http://www.trentswanson.com/post/2008/01/Calling-SharePoint-web-services-using-Visual-Studio-20082c-WCF2c-and-Windows-Auth.aspx"&gt;Calling SharePoint web services using Visual Studio 2008, WCF, and Windows Authentication&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://darrinbishop.com/blog/archive/2007/11/28/psfivefunctions.aspx" target=_blank mce_href="http://darrinbishop.com/blog/archive/2007/11/28/psfivefunctions.aspx"&gt;Five Simple But Powerful PowerShell Functions/Filters for SharePoint&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9029678" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Windows+SharePoint+Services/default.aspx">Windows SharePoint Services</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Windows+Communication+Foundation/default.aspx">Windows Communication Foundation</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/PowerShell/default.aspx">PowerShell</category></item><item><title>Walkthrough: Import Data From a Line Of Business System into SharePoint User Profiles</title><link>http://blogs.msdn.com/johnwpowell/archive/2008/10/04/walkthrough-import-data-from-a-line-of-business-system-into-sharepoint-user-profiles.aspx</link><pubDate>Sat, 04 Oct 2008 22:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8976639</guid><dc:creator>johnwpowell</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/8976639.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=8976639</wfw:commentRss><description>&lt;P&gt;In this walkthrough, I'll show you how to import data from a line of business (LOB) system into SharePoint user profiles and make that information searchable.&amp;nbsp; Using this approach, you can leverage information that is stored in other LOB systems and create a unified view of user information in SharePoint.&lt;/P&gt;
&lt;H3&gt;Create an Interface to the LOB System&lt;/H3&gt;
&lt;P&gt;Suppose your company has an HR system that contains information about employees.&amp;nbsp; Since it is the system of record for employee data, we don't want users to re-enter this information in SharePoint.&amp;nbsp; In this example, the HR system is backed by Sql Server and the data we need is stored in a table named "Employee."&amp;nbsp; Although we are accessing the database directly in this walkthrough, you should consider using a web service to provide a layer of abstraction and a well-defined interface.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In our HR system, the Employee table contains a column that we can use to look up employees based on information we have in SharePoint.&amp;nbsp; In this case, we will use the "UserAccountName" column, but in a real-world implementation you need to find a key that is guaranteed to be unique such as the user's security identifier (SID).&amp;nbsp; The following shows the design of the Employee table:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image31.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image31.png"&gt;&lt;IMG height=414 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image31_thumb.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image31_thumb.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When SharePoint to imports data from the HR system, it is essentially a crawl operation, so the SharePoint search account will need read access to the Employee table.&amp;nbsp; Because this database contains sensitive information, we will only allow the account access what it needs and nothing more: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_4.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_4.png"&gt;&lt;IMG height=414 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Create Application Definition&lt;/H3&gt;
&lt;P&gt;Ceate an application definition XML file so SharePoint knows what entities and actions are available from the HR system.&amp;nbsp; We &lt;EM&gt;could&lt;/EM&gt; do this by hand, but it is much easier to use a tool such as &lt;A href="http://www.bdcmetaman.com/" target=_blank mce_href="http://www.bdcmetaman.com/"&gt;BDC Meta Man&lt;/A&gt;.&amp;nbsp; To start, select &lt;EM&gt;Connect to data source&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_15.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_15.png"&gt;&lt;IMG height=289 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_1.png" width=289 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_1.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Enter database connection information and click &lt;EM&gt;Connect&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_55.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_55.png"&gt;&lt;IMG height=275 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_4.png" width=358 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_4.png"&gt;&lt;/A&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Once connected, drag the Employee table onto the design surface:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_24.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_24.png"&gt;&lt;IMG height=480 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_11.png" width=638 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_11.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The tool generates the Employee entity and three actions: Finder, Specific Finder and IDEnumerator.&amp;nbsp; If you are not familiar with these terms, here is a simple explanation.&amp;nbsp; A Finder returns a list of entities.&amp;nbsp; A Specfic Finders returns a single entity, and an IDEnumerator returns the identifiers of all entities.&amp;nbsp; By default, the tool uses the primary key as the parameter to the specific finder.&amp;nbsp; Since we don't have the employee number in SharePoint, we need to modify the Specific Finder action to take an account name.&amp;nbsp; Select the action and click &lt;EM&gt;Modify&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_62.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_62.png"&gt;&lt;IMG height=342 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_30.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_30.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Clear the condition from the EmployeeNumber column and add a condition to the UserAccountName.&amp;nbsp; Click &lt;EM&gt;Generate&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_66.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_66.png"&gt;&lt;IMG height=465 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_32.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_32.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;You'll see a preview of the query.&amp;nbsp; Click &lt;EM&gt;OK&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_70.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_70.png"&gt;&lt;IMG height=307 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_34.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_34.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;If prompted to configure parameters, just put something in the fields (like a space) and click &lt;EM&gt;OK&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_68.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_68.png"&gt;&lt;IMG height=240 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_33.png" width=298 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_33.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Edit the HR System details:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_26.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_26.png"&gt;&lt;IMG height=161 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_12.png" width=342 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_12.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;You can use this screen to modify the system and instance name.&amp;nbsp; You can also set the authentication mode, which we'll set to &lt;EM&gt;RevertToSelf&lt;/EM&gt;.&amp;nbsp; This basically means, "whoever you are impersonating, revert to who you were."&amp;nbsp; So if you were accessing an entity as contoso\johndoe it would revert back to the SharePoint application pool account.&amp;nbsp; If you used PassThrough, contoso\johndoe would be accessing the database as himself.&amp;nbsp; After configuring the system, click &lt;EM&gt;Save&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_28.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_28.png"&gt;&lt;IMG height=400 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_13.png" width=371 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_13.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Select Configuration &amp;gt; Settings and specify where the XML file should be saved.&amp;nbsp; Enter a path and click &lt;EM&gt;Save&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_30.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_30.png"&gt;&lt;IMG height=264 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_14.png" width=631 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_14.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Click the green "play" button to generate the application defintion&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_72.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_72.png"&gt;&lt;IMG height=480 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_35.png" width=638 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_35.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Import Application Definition&lt;/H3&gt;
&lt;P&gt;Go to your Shared Services web site and select &lt;EM&gt;Import application definition&lt;/EM&gt; in the Business Data Catalog section.&amp;nbsp; Browse for the application definition file and click &lt;EM&gt;Import&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_34.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_34.png"&gt;&lt;IMG height=323 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_16.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_16.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Configure BDC Permissions&lt;/H3&gt;
&lt;P&gt;Configure the SharePoint permissions for the application and entities.&amp;nbsp; Click &lt;EM&gt;Manage Permissions&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_36.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_36.png"&gt;&lt;IMG height=244 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_17.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_17.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Select the search account, check the Execute permission and click &lt;EM&gt;Save:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_38.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_38.png"&gt;&lt;IMG height=309 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_18.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_18.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The search account needs access to both the application and the employee entity, so from the manage permission screen for the application, click &lt;EM&gt;Copy all permissions to descendents&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_40.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_40.png"&gt;&lt;IMG height=135 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_19.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_19.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;This will copy the same permissions from the application to all of the entities in that application&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_42.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_42.png"&gt;&lt;IMG height=119 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_20.png" width=386 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_20.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Test the BDC Application&lt;/H3&gt;
&lt;P&gt;You can test the application by accessing the profile page for the Employee entity.&amp;nbsp; You can find the url of the profile page by viewing the entity:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_63.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_63.png"&gt;&lt;IMG height=403 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_7.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_7.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Copy the url into a browser and enter a parameter for UserAccountName.&amp;nbsp; You will see a generic error message "Unable to connect to [Instance Name]."&amp;nbsp; This is because we used RevertToSelf and the account accessing the database is the application pool account (contoso\spfarm in this example).&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_59.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_59.png"&gt;&lt;IMG height=398 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_6.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_6.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;To prove this, grant the application pool account rights to the Employee table and the entity details will display&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_57.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_57.png"&gt;&lt;IMG height=399 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_5.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_5.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Give the Search Account Permission to Update User Profiles&lt;/H3&gt;
&lt;P&gt;Because the import is running as the search account, &lt;EM&gt;that user must have the permission to update user profiles&lt;/EM&gt;.&amp;nbsp; To configure this, from Shared Services, select &lt;EM&gt;Personalization services permissions&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_89.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_89.png"&gt;&lt;IMG height=193 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_9.png" width=315 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_9.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Click &lt;EM&gt;Add Users/Groups&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_91.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_91.png"&gt;&lt;IMG height=165 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_15.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_15.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Enter the search account and check the Manage user profiles permission.&amp;nbsp; Click &lt;EM&gt;Save&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_93.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_93.png"&gt;&lt;IMG height=264 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_27.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_27.png"&gt;&lt;/A&gt;&amp;nbsp; &lt;/P&gt;
&lt;H3&gt;Add an Import Connection&lt;/H3&gt;
&lt;P&gt;Next, we will configure the user profile to import the Location column into the SharePoint user profile.&amp;nbsp; In the Shared Services web site, select &lt;EM&gt;User profiles and properties&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_50.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_50.png"&gt;&lt;IMG height=186 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_24.png" width=257 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_24.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;To connect to the HR System, you have to create an import connection.&amp;nbsp; To do this, click &lt;EM&gt;View import connections:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_52.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_52.png"&gt;&lt;IMG height=306 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_25.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_25.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Click &lt;EM&gt;Create New Connection&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_54.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_54.png"&gt;&lt;IMG height=129 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_26.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_26.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Select Business Data Catalog and choose the entity.&amp;nbsp; There should only be one employee for each SharePoint user profile, so we'll select 1:1 mapping.&amp;nbsp; Next, we must specify the attribute in the UserProfile to pass to the Specific Finder method.&amp;nbsp; Select &lt;EM&gt;AccountName&lt;/EM&gt; and click &lt;EM&gt;OK&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_74.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_74.png"&gt;&lt;IMG height=383 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_36.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_36.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;H3&gt;Add a User Profile Property and Map to a BDC Entity Attribute&lt;/H3&gt;
&lt;P&gt;Add a property to the SharePoint user profile to contain the Location we are importing from the HR system.&amp;nbsp; Click &lt;EM&gt;Add profile property&lt;/EM&gt;: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_76.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_76.png"&gt;&lt;IMG height=165 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_37.png" width=474 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_37.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Enter a Name, Display Name and configure privacy and editing rights:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_78.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_78.png"&gt;&lt;IMG height=396 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_38.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_38.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In the &lt;EM&gt;Source Data Connection&lt;/EM&gt; drop down, select the import connection you created in the previous step.&amp;nbsp; Select the field to map from the HR System:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_80.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_80.png"&gt;&lt;IMG height=423 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_39.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_39.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Perform a Full User Profile Import&lt;/H3&gt;
&lt;P&gt;Select &lt;EM&gt;Start full import&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_6.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_6.png"&gt;&lt;IMG height=354 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_2.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_2.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The primary (AD) import will run and then there will be a short pause before the Membership and BDC import starts: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_8.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_8.png"&gt;&lt;IMG height=443 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_3.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;After the import completes, check the import log for errors:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_84.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_84.png"&gt;&lt;IMG height=169 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_41.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_41.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;If you encounter errors, you'll have to comb through the ULS logs to find the specific issue:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_86.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_86.png"&gt;&lt;IMG height=87 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_42.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_42.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Verify the Import Worked&lt;/H3&gt;
&lt;P&gt;On the user profile page, select &lt;EM&gt;View user profiles&lt;/EM&gt; and select a profile.&amp;nbsp; The property should now contain data from the HR System: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_88.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_88.png"&gt;&lt;IMG height=135 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_43.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_43.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Make the Imported Property Searchable&lt;/H3&gt;
&lt;P&gt;Now we'll do something useful with the information we imported from the HR System by making it searchable.&amp;nbsp; We'll create a search scope so you can search for people by location.&amp;nbsp; When we added the location property to the user profile the check box was selected to make the property indexed:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_44.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_44.png"&gt;&lt;IMG height=127 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_8.png" width=655 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_8.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before the property can be used in search, we must perform a full crawl.&amp;nbsp; From the Shared Services website, access &lt;EM&gt;Search Settings&lt;/EM&gt;.&amp;nbsp; Click on &lt;EM&gt;Content sources and crawl schedules&lt;/EM&gt;.&amp;nbsp; Select &lt;EM&gt;Local Office SharePoint Server Sites&lt;/EM&gt; &amp;gt; &lt;EM&gt;Start Full Crawl&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_46.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_46.png"&gt;&lt;IMG height=340 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_10.png" width=361 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_10.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Create a Search Scope&lt;/H3&gt;
&lt;P&gt;Once the crawl completes, return to &lt;EM&gt;Search Settings&lt;/EM&gt; and select &lt;EM&gt;Metadata property mappings&lt;/EM&gt;.&amp;nbsp; Locate the property you added to the user profile and edit it.&amp;nbsp; Check the box "&lt;EM&gt;Allow this property to be used in scopes&lt;/EM&gt;."&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_48.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_48.png"&gt;&lt;IMG height=393 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_21.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_21.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Return to &lt;EM&gt;Search Settings&lt;/EM&gt; and select &lt;EM&gt;View Scopes&lt;/EM&gt;.&amp;nbsp; Click &lt;EM&gt;New Scope.&amp;nbsp; &lt;/EM&gt;Enter a name for the scope such as "Hong Kong Employees," and click &lt;EM&gt;OK:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_82.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_82.png"&gt;&lt;IMG height=248 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_22.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_22.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Next, add a rule to the scope by clicking on &lt;EM&gt;Add rules&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_95.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_95.png"&gt;&lt;IMG height=196 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_23.png" width=567 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_23.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Select Property Query and select the user profile location property we added.&amp;nbsp; Enter a value such as "Hong Kong."&amp;nbsp; Select &lt;EM&gt;Require&lt;/EM&gt; and click &lt;EM&gt;OK:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_97.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_97.png"&gt;&lt;IMG height=273 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_28.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_28.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Return to Search Settings and in the Scopes section, click &lt;EM&gt;Start update now&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_99.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_99.png"&gt;&lt;IMG height=213 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_29.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_29.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;From the Shared Services website, access &lt;EM&gt;Search Settings&lt;/EM&gt;.&amp;nbsp; Click on &lt;EM&gt;Content sources and crawl schedules&lt;/EM&gt;.&amp;nbsp; Select &lt;EM&gt;Local Office SharePoint Server Sites&lt;/EM&gt; &amp;gt; &lt;EM&gt;Start Full Crawl&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_46.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_46.png"&gt;&lt;IMG height=340 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_10.png" width=361 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_10.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;You can confirm the scope contains items by viewing the scopes:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_101.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_101.png"&gt;&lt;IMG height=134 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_31.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_31.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Use the Search Scope in a Site Collection&lt;/H3&gt;
&lt;P&gt;Access the site collection settings and add the scope.&amp;nbsp; From &lt;EM&gt;Site Collection Administration&lt;/EM&gt;, select &lt;EM&gt;Search scopes&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_103.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_103.png"&gt;&lt;IMG height=103 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_40.png" width=187 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_40.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Notice the search scope you created is in the Unused Scopes section.&amp;nbsp; We want it to display in the search dropdown, so click on &lt;EM&gt;Search Dropdown&lt;/EM&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_105.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_105.png"&gt;&lt;IMG height=267 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_44.png" width=593 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_44.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Check the box to include the new scope:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_107.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_107.png"&gt;&lt;IMG height=323 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_45.png" width=585 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_45.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The search dropdown will now display the new scope.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_109.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_109.png"&gt;&lt;IMG height=78 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_46.png" width=240 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/e20d0974d10e_9EB5/image_thumb_46.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;You can further customize the search scope so it takes you to the people search results page.&amp;nbsp; You could even add a tab to the Search center for each location (scope) such as "Seattle," "New York" and "Hong Kong" to make a people directory.&amp;nbsp; Finally, you can add people search web parts in other parts of the site collection to enable users to quickly find people.&lt;/P&gt;
&lt;H3&gt;Conclusion&lt;/H3&gt;
&lt;P&gt;In this walkthrough, I showed you how to import data from a line of business (LOB) system into SharePoint user profiles and make that information searchable.&amp;nbsp; This approach enables you to expose data from LOB systems and display the information in the user's profile and other areas in SharePoint.&lt;/P&gt;
&lt;H3&gt;References and Additional Reading&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://sharepointsearch.com/pages/article.aspx?itemid=7" target=_blank mce_href="http://sharepointsearch.com/pages/article.aspx?itemid=7"&gt;SharePoint Search Security Explained&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blah.winsmarts.com/2007-4-SharePoint_2007__BDC_-_User_Profiles.aspx" target=_blank mce_href="http://blah.winsmarts.com/2007-4-SharePoint_2007__BDC_-_User_Profiles.aspx"&gt;SharePoint 2007: BDC - User Profiles&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://weblogs.asp.net/danlewis/archive/2008/09/05/resolution-for-event-id-7888-only-site-admin-can-access-data-source-object-from-user-profile-db.aspx" target=_blank mce_href="http://weblogs.asp.net/danlewis/archive/2008/09/05/resolution-for-event-id-7888-only-site-admin-can-access-data-source-object-from-user-profile-db.aspx"&gt;Resolution for Event ID 7888 - Only site admin can access Data Source object from user profile DB&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8976639" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/BDC/default.aspx">BDC</category></item><item><title>SharePoint BDC Error: Cannot have more than 30 Parameters for a Method</title><link>http://blogs.msdn.com/johnwpowell/archive/2008/09/27/sharepoint-bdc-error-cannot-have-more-than-30-parameters-for-a-method.aspx</link><pubDate>Sat, 27 Sep 2008 18:38:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8967620</guid><dc:creator>johnwpowell</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/8967620.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=8967620</wfw:commentRss><description>&lt;p&gt;One thing to be aware of is that the BDC has a hard limit of 30 parameters.&amp;nbsp; If you use the BDC as designed, you likely will never hit this limit, but if you are trying to implement insert/update functionality you may encounter this little gotcha.&amp;nbsp; When it happens, you will see the following error message:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointBDCErrorCannothavemorethan30Pa_A39F/image_2.png" target="_blank"&gt;&lt;img height="273" alt="image" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointBDCErrorCannothavemorethan30Pa_A39F/image_thumb.png" width="853" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The &lt;a href="http://www.lightningtools.com/bdc-meta-man/default.aspx" target="_blank"&gt;BDC Meta Man&lt;/a&gt; tool has a write-back feature that adds custom actions for inserting and updating.&amp;nbsp; The tool will create an insert action and an update action, and add a parameter for each selected column. &lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointBDCErrorCannothavemorethan30Pa_A39F/image_4.png" target="_blank"&gt;&lt;img height="410" alt="image" src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/SharePointBDCErrorCannothavemorethan30Pa_A39F/image_thumb_1.png" width="770" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Beware of the 30 parameter limit when designing BDC solutions.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8967620" width="1" height="1"&gt;</description></item><item><title>How to Create a Reusable WCF Service Host for Windows Services and Self-Hosting</title><link>http://blogs.msdn.com/johnwpowell/archive/2008/09/20/how-to-create-a-reusable-wcf-service-host-for-windows-services-and-self-hosting.aspx</link><pubDate>Sat, 20 Sep 2008 23:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8960197</guid><dc:creator>johnwpowell</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/8960197.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=8960197</wfw:commentRss><description>&lt;P&gt;In this article, I'll show you how to create a reusable service host that can be run from either from the console (self-hosted) or installed as a Windows service.&amp;nbsp; I'll also demonstrate how to use a configuration file instead of code to control which WCF services the host starts.&amp;nbsp; Finally, I'll show how you can make the Windows service installer flexible to allow you to run multiple versions of the service on the same machine.&amp;nbsp; Before getting into implementation details, I'd like to share my motivations behind this solution.&lt;/P&gt;
&lt;H3&gt;Why I Developed This Solution&lt;/H3&gt;
&lt;P&gt;If you have been doing WCF development, you have probably experienced some pain around service hosting.&amp;nbsp; Some of the things I found frustrating on my first WCF project included:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Making a decision on the type of service host 
&lt;LI&gt;Discovering it's more work to host as a Windows service than IIS! 
&lt;LI&gt;Installing, starting, stopping and uninstalling a service during development 
&lt;LI&gt;Re-writing the same Windows service plumbing for each WCF service 
&lt;LI&gt;Having to change code if I wanted to add or remove the WCF services that are hosted 
&lt;LI&gt;Trying to host multiple versions of a service on the same machine&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Having learned a few things, but by no means an expert, I decided to implement a more flexible and reusable service host to meet these goals:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create a single Windows service project that can be shared by all WCF services in the solution 
&lt;LI&gt;Keep the service project separate from the service host project 
&lt;LI&gt;Ability to run the service host from the console or a Windows service 
&lt;LI&gt;Ability to test the service host during development without having to install it 
&lt;LI&gt;Ability to host multiple versions of a service on the same machine in production 
&lt;LI&gt;Ability to control which WCF services are hosted without having to make code changes&lt;/LI&gt;&lt;/UL&gt;
&lt;H3&gt;How it Works&lt;/H3&gt;
&lt;P&gt;Now that you understand the &lt;EM&gt;why&lt;/EM&gt;, I'll show you &lt;EM&gt;how&lt;/EM&gt; the service host works starting with the entry point: Main().&amp;nbsp; The output type of a Windows service project is an executable.&amp;nbsp; When the service starts, it calls the executable.&amp;nbsp; Here is the default Main method for a Windows service project:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_4.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_4.png"&gt;&lt;IMG height=259 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_1.png" width=409 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;As you can see this code creates an instance of the service and runs it.&amp;nbsp; To execute this code, you have to install the service and start it.&amp;nbsp; Although it seems like you could run the executable from the command line, you will receive the following error if you try:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_8.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_8.png"&gt;&lt;IMG height=197 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_3.png" width=489 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;So to get around this, we are going to send an argument to the executable that switches it between a Windows service and self-hosting.&amp;nbsp; During development, we can configure Visual Studio to pass the command line argument to test the code.&amp;nbsp; In production, this same mechanism can provide additional diagnostic capabilities.&amp;nbsp; Here is the new implementation of Main():&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_6.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_6.png"&gt;&lt;IMG height=582 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_2.png" width=602 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Running the Service Host from the Command Line&lt;/H3&gt;
&lt;P&gt;When run from the command line using the self-hosting argument, the service host starts the WCF services and outputs information to the console:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_10.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_10.png"&gt;&lt;IMG height=357 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_4.png" width=741 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_4.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Running the Service Host as a Windows Service&lt;/H3&gt;
&lt;P&gt;To run the service host as a Windows service, you first must install it.&amp;nbsp; To do this, copy the output of the service host project to a directory on the server.&amp;nbsp; If there are two versions of the service to run, you'd copy the output to different folders (you also need to configure the services to have different endpoints in the configuration file).&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_14.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_14.png"&gt;&lt;IMG height=223 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_6.png" width=555 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_6.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To install the service, run installutil on the service host executable, passing different parameters for the name and displayname, for example:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;cd C:\Windows\Microsoft.NET\Framework64\v2.0.50727 &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;installutil /name=CalcV1 /displayname="Calc V1" /description="Sample Calculator Service" "c:\CalcV1\WcfSample.Service.Host.exe"&lt;BR&gt;installutil /name=CalcV2 /displayname="Calc V2" /description="Sample Calculator Service" "c:\CalcV2\WcfSample.Service.Host.exe"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;After installing, you will see the services in Windows:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_12.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_12.png"&gt;&lt;IMG height=44 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_5.png" width=578 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_5.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;To update the WCF service, stop the Windows service, copy the new WCF service dll and restart the Windows service.&amp;nbsp; There shouldn't be a need to update the service host executable.&amp;nbsp; To uninstall the service, use the /u argument, for example:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;installutil /u /name=CalcV1 "c:\CalcV1\WcfSample.Service.Host.exe"&lt;BR&gt;installutil /u /name=CalcV2 "c:\CalcV2\WcfSample.Service.Host.exe"&lt;/EM&gt;&lt;/P&gt;
&lt;H3&gt;Using the Same Service Host for Multiple WCF Services&lt;/H3&gt;
&lt;P&gt;In the previous section, you saw parameters passed into the service installer (note the forward slash parameter name format such as /name).&amp;nbsp; In the service host project, there is an installer component.&amp;nbsp; In that component, you can access the parameters through the Context object.&amp;nbsp; So instead of hard-coding the service name, we set the service name from the parameters.&amp;nbsp; That's all there is to it.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_20.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_20.png"&gt;&lt;IMG height=247 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_9.png" width=631 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_9.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Controlling Which WCF Services are Hosting Using a Configuration File&lt;/H3&gt;
&lt;P&gt;Now, let's examine how to control which WCF services are hosted using a configuration file.&amp;nbsp; I was initially planning to iterate the service elements in the system.serviceModel section and start all services.&amp;nbsp; You can see an example in this &lt;A href="http://www.topxml.com/rbnews/WSCF/WCF/re-42352_Start-ServiceHosts-for-all-configured-Services.aspx" target=_blank mce_href="http://www.topxml.com/rbnews/WSCF/WCF/re-42352_Start-ServiceHosts-for-all-configured-Services.aspx"&gt;post&lt;/A&gt; and this &lt;A href="http://blogs.thinktecture.com/ingo/archive/2006/09/05/414686.aspx" target=_blank mce_href="http://blogs.thinktecture.com/ingo/archive/2006/09/05/414686.aspx"&gt;post&lt;/A&gt;.&amp;nbsp; I found two problems with this approach.&amp;nbsp; First, you can't control which services to start--like if I wanted to have the configuration for five WCF services, but only start one.&amp;nbsp; Second, the service name element doesn't allow you to specify an assembly name, just the namespace and class.&amp;nbsp; I need the assembly name to load the WCF service type at runtime.&amp;nbsp; To overcome both of these problems, I created a configuration section that allows you to specify which services to start.&amp;nbsp; Here is a sample configuration showing this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_16.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_16.png"&gt;&lt;IMG height=355 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_7.png" width=640 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_7.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The service container class gets the custom configuration section and iterates through the services list and starts each one:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_18.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_18.png"&gt;&lt;IMG height=434 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_8.png" width=1077 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_8.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Separating the WCF Service from the Service Host&lt;/H3&gt;
&lt;P&gt;One of the goals I had for this solution was to separate concerns by keeping the WCF service separate from the service host.&amp;nbsp; In the example below, you can see how the Calculator service is in a separate project than the Host.&amp;nbsp; The only coupling between these two projects is necessary.&amp;nbsp; The Host project has a project reference to the WCF service project so we can load the service assembly at runtime.&amp;nbsp; In this example, there is only one service project, but you can imagine a separate project for each type of service.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_22.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_22.png"&gt;&lt;IMG height=350 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_10.png" width=285 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/HowtoCreateaWCFServiceHostforHostingServ_C4C0/image_thumb_10.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;H3&gt;Conclusion and Link to Download the Code&lt;/H3&gt;
&lt;P&gt;This article presented an approach for creating a reusable WCF service host that enables you to specify which WCF services to run using configuration and support hosting multiple versions of a service on the same machine.&amp;nbsp; Hopefully, the techniques presented here improve your WCF service development and deployment experience.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://cid-7cedcb8ed3a44629.skydrive.live.com/self.aspx/Public/WcfSampleServiceHost.zip" target=_blank mce_href="http://cid-7cedcb8ed3a44629.skydrive.live.com/self.aspx/Public/WcfSampleServiceHost.zip"&gt;Get the Code&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8960197" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Windows+Communication+Foundation/default.aspx">Windows Communication Foundation</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/WCF/default.aspx">WCF</category></item></channel></rss>