• Team Development for Sitecore

    TDS and Sitecore.* DLLs

    Posted 05/15/2012 by techphoria414

    One fail-safe feature of Team Development for Sitecore that has bit me a few times is its prevention of Sitecore.* DLLs from copying to your web root during a build. Though I appreciate TDS lookin out, there are times when you have non-module libraries, or modified Shared Source libraries, that you do want deployed on build. To work around this, you can utilize the BeforeFileReplacements build target. Place the following in your TDS csproj, just before the closing </Project>, and edit DeploySitecoreBinaries as needed for your assemblies.

    <Target Name="BeforeFileReplacements">
        <!-- restore certain Sitecore.* DLLs that TDS does not copy -->
        <!-- BeforeFileReplacements will be called after TDS has deleted Sitecore.* from its Output, but before it deploys -->
        <ItemGroup>
          <DeploySitecoreBinaries Include="$(SourceWebPhysicalPath)\Bin\Sitecore.SharedSource.Search.dll;
    $(SourceWebPhysicalPath)\Bin\Sitecore.Sharedsource.dll;
    $(SourceWebPhysicalPath)\Bin\Sitecore.Sharedsource.PartialLanguageFallback.dll;" />
        </ItemGroup>
        <Copy SourceFiles="@(DeploySitecoreBinaries)"
    DestinationFiles="@(DeploySitecoreBinaries->'$(_OutputPath)bin\%(RecursiveDir)%(FileName)%(Extension)')" />
      </Target>

    Read more... Pre-Disqus Comments (4)
  • Techphoria414

    T414 Sitecore Best Practices Part 2: Solution Structure and Working with TDS

    Posted 02/07/2012 by techphoria414

    The T414 Sitecore Best Practices Series is a screencast overview of the foundational pieces we use at Hanson Dodge Creative in our Sitecore development projects. Part 2 dives into the specifics of Visual Studio solution structure, TDS project configuration, and using TDS.

    Part 1: Introduction to TDS is available here.

    Part 3: Sublayout Development with Custom Items and Scriptlets is available here.

    UPDATE:
    Sean Holmesby of Igloo Digital has a nice series of posts that also get into some details of TDS use and configuration, including some known "gotchas" that you may run into.

    UPDATE #2:
    If you're having trouble getting your Sitecore.* DLLs to copy on build, check this out.

    Read more... Pre-Disqus Comments (5)
  • Techphoria414

    T414 Sitecore Best Practices Part 1: Introduction to TDS

    Posted 02/06/2012 by techphoria414

    Over the next 3 days I'll be posting a series of screencast videos that demonstrate the standards and best practices we've developed for Sitecore projects at Hanson Dodge Creative. The foundational pieces of our standards include Team Development for Sitecore (TDS), the Custom Item Generator shared source module, and scriptlet-based sublayout development. Part 1 of the series is a shorter video providing a high-level introduction to TDS and the separation of development and web roots on your filesystem.

    You can also view the Prezi that I created for this screencast.

    Part 2: Solution Structure and Working with TDS is available here.

    Part 3: Sublayout Development with Custom Items and Scriptlets is available here.


    Happy Sitecoring,
    Nick Wesselman / techphoria414

    Read more... Pre-Disqus Comments (4)
  • A Failsafe For non-Debug TDS Builds

    Posted 09/15/2011 by techphoria414

    Another advantage of Team Development for Sitecore is that deployment to your various environments can be configured as part of the Solution's Build Configurations, allowing you to easily deploy either right from your desktop or as part of an automated build process. The side effect of this is that if you don't remember switching to say, your QA server's build configuration, you can easily deploy in-progress code to an environment that's not your local machine. (I will not confirm nor disconfirm I've done this.) Though you probably don't want your production environment fully configured in TDS anyway, even a deploy to a QA or UAT server would be enough to get someone knocking on your door asking why "everything is broken."


    We put together a quick failsafe to prevent this. You'll need to install the MSBuild Extension Pack. The example below assumes v4.0, x86. If the build is running in Visual Studio, and is anything other than a Debug build, a confirmation dialog appears that requires you to type in a super secret password before the build will continue. To add to your build, unload your TDS project, edit the .csproj, and paste in, perhaps near the bottom of the project config.


        <Import Project="$(MSBuildExtensionsPath)\ExtensionPack\4.0\MSBuild.ExtensionPack.tasks" />
        <Target Name="BeforeSitecoreBuild">
            <CallTarget Targets="ConfirmNonDebugBuild" Condition="'$(BuildingInsideVisualStudio)' == 'true' And '$(Configuration)' != 'Debug'"/>
        </Target>
        <Target Name="ConfirmNonDebugBuild">
            <MSBuild.ExtensionPack.UI.Dialog TaskAction="Prompt" Title="Confirm Build" Button2Text="Cancel" Text="Type 'whiskey' below to confirm build to $(Configuration)">
                <Output TaskParameter="ButtonClickedText" PropertyName="Clicked"/>
                <Output TaskParameter="UserText" PropertyName="Typed"/>
            </MSBuild.ExtensionPack.UI.Dialog>
            <Message Text="Button Text: $(Clicked) / Text: $(Typed)" Importance="high"/>
            <Error Condition="$(Clicked) == 'Cancel' Or $(Typed) != 'whiskey'"/>
        </Target>

    Read more... Pre-Disqus Comments (1)
  • TDS and Sitecore.* DLLs

    Posted 09/12/2011 by techphoria414

    Quick one for you. If you're using TDS for Sitecore, you've no doubt run into the issue that any DLLs starting with Sitecore.* will not deploy. Though an admirable protection against deployment of core Sitecore DLLs, it can be an issue with Shared Source modules that are not installed through packages, or Sitecore.Support.* DLLs. The quick fix is to unload your TDS project and edit its .csproj, and add a BeforeFileReplacements event handler such as the following.

      <Target Name="BeforeFileReplacements">
        <!-- restore certain Sitecore.* DLLs that TDS refuses to copy -->
        <!-- BeforeFileReplacements will be called after TDS has deleted Sitecore.*
        from its Output, but before it deploys -->
        <ItemGroup>
          <DeploySitecoreBinaries Include="$(SourceWebPhysicalPath)\Bin\Sitecore.SharedSource.Search.dll;" />
        </ItemGroup>
        <Copy SourceFiles="@(DeploySitecoreBinaries)"
    DestinationFiles="@(DeploySitecoreBinaries->'$(_OutputPath)bin\%(RecursiveDir)%(FileName)%(Extension)')" />
      </Target>

    UPDATE 9/14/2011: Changed the name of the Item Group. It was deploying everything in the bin\ folder, including Sitecore.Kernel. I assume because the group name SourceWebBinaries was previously used by TDS.

    Enjoy, 
    Nick / @techphoria414

    Read more...
Sitecore MVP

Popular Posts

Syndication

Archive