The Ramblings of Two Microsoft .NET Developers, TFS, and Visual Studio ALM Guys --- "Yes, we are both named Ed."

Replacing Compare and Diff Tools for TFS Version Control



Even though the TFS product team is planning to completely replace the awful source compare experience in the next version of TFS, I need something for use with prior versions of Visual Studio including Visual Studio 2010.  The new version inside of Visual Studio 11 is pretty awesome.  I have actually decided on Code Compare Pro by Devart for my legacy versions.  They have both a free version and a Pro version that includes a 30-day trial.

During the installation, you can specify whether you want to integrate Code Compare with the TFS tools and when you do that, it adds the relevant settings automatically to your Visual Studio options for TFS Version Control.  That’s classy and a nice touch for the installer.  BTW – this is the exact way you would do this manually if you have a different compare tool that you like better.  There are plenty out there…

Code Compare Options Set for Compare and Merge in TFS for Visual Studio Options Dialog

This now allows you to use your new specified tool anytime you would do a compare or merge operation even from the Windows Explorer Shell Extensions plug-in from the TFS Power Tools.  It will even allow for a three-way merge & diff experience which can be quite helpful at times if you are in need of it.

Code Compare Pro Compare Diff with TFS Version Control

Ed Blankenship



Using the Related Twitter Accounts Tag in the Tweet Button



If you have a site like ours, you might want to give people the opportunity to share your content socially.  One of the ways you can do that is using the Tweet Button for Twitter.  It’s actually super easy to implement.

One of the things you might also do is to specify “related Twitter accounts” that a user might be interested in.  You would normally include your account in the “via” tag but you can give Twitter the chance to suggest additional users for a person to follow whenever they share some of your account.  In my case, I may want to give people a chance to follow the account for Imaginet, the company I work for, @justimaginet.  You do this by specifying the “data-related” tag in your hyperlink.  You can specify as many accounts as you want but they are really just suggestions to Twitter.  Take a look at the documentation mentioned below about if you want to specify multiple accounts.

Here’s an example of what I used to update the itemTemplate.blogtemplate file for my dasBlog site.

<div class="twitter-badge">
    <a href="https://twitter.com/share" class="twitter-share-button" 
        data-url="<%PermalinkUrl()|edsquared%>"
        data-text="<%ItemTitleText()|edsquared%>" data-count="horizontal" 
        data-via="<%ItemAuthorTwitterAccount()|edsquared%>"
        data-related="justimaginet:Imaginet - Microsoft ALM Partner of the Year">Tweet</a>
</div>

Give it a try out by visiting our blog site and using one of the Tweet buttons to share the content to your followers:  http://www.edsquared.com

If you are wanting to research this a little more, here’s the official documentation from Twitter:

Related accounts

Using the related field you can suggest accounts for a user to follow once they have sent a Tweet using your Tweet Button. These suggested accounts and their basic information are shown on the last page of the Share Box flow.

Only two accounts are displayed and by default the via user is shown first with the first related account shown afterwards. If the user is a follower of the via user the Share Box will instead show the first two related accounts the user isn't a follower of. No accounts are displayed if the user follows all of the suggested accounts (via and related).

You can add your own summary of a related user by adding some text after their screen name, separated using a colon. For example, to add a summary The Javascript API to the related user @anywhere you would use:

data-related="anywhere:The Javascript API"

The summary is shown above the related user and is in addition to the default information like the bio and verified status. Summaries should not include commas or colons and can only be added to related accounts.

Tweet Button - Twitter Share Dialog

You can provide multiple related accounts by comma separating entries in the data-related value:

data-related="anywhere:The Javascript API,sitestreams,twitter:The official account"

You learn something every day…

Ed Blankenship

Posted in


Awarded as Microsoft MVP for 2012



Microsoft Most Valuable Professional (MVP) LogoI’m really happy to have been awarded again for 2012 as a Microsoft Most Valuable Professional in Visual Studio ALM & TFS!  This will be my fifth year as a Microsoft MVP and it’s always an honor to work with each of my colleagues in the MVP community.  Very much looking forward to the MVP Summit coming up next month and continuing to help out where I can in the ALM community.  Thanks to everyone who have helped me in the past few years and congratulations to all of the other new & repeat awardees of the Microsoft MVP award for this year.

I wish everyone a great new year in 2012!

Ed Blankenship



Integrating Red Gate SmartAssembly Into TFS 2010 Build



Updates – I plan on making updates to this blog article from time to time as I learn more and changes are made to TFS & SmartAssembly to smooth out some of the rough edges.  Come back again for the latest & greatest!

I really like tools that provide assistance with the release management & maintenance cycles of ALM.  I think some of the features really add a particular shine to your application.  It’s something that I’m currently writing an article about but I wanted to share how to integrate one of those tools into your Team Foundation Server 2010 Build Process.  This first tool to be reviewed is Red Gate’s SmartAssembly product.Red Gate SmartAssembly

SmartAssembly is a product that can help you out with obfuscation if you need it but I primarily want to focus on two of its other major features:

  • Automated Error Reporting – When an exception occurs, the end user can be prompted to send back the exception details so that the development team can review those details.  This can also work with server-side & web applications without requiring end user prompting.
  • Feature Usage Reporting – This is essentially telemetry for your application to figure out how your users are using the application so that you can make good decisions in the future about where to invest for future releases.  It does this by sending back anonymous data for users who opt-in at runtime.  It will even automatically send back data about the machine the software is being run like the operating system.  This can be extremely useful data to product managers.

You don’t have to worry about any of the details because once you run your assemblies through SmartAssembly, it instruments all of the necessary functionality automatically for you.  If you acquire the Professional edition, you can customize the reporting experience including the ability to host your own web server to accept the error & feature usage reports.

Aside:  Too many teams & companies have blindly adopted obfuscation for their assemblies in the past without taking into consideration the true “total cost” of obfuscating your applications.  I’m all for obfuscation where it makes sense to protect IP as long as the value of the protection of that IP is worth more than the extra cost, resources, and maintenance complexity to truly support an obfuscated product.  Each team & company is going to have to make that decision based on the resources available and the value of the IP to be protected  – just don’t go into it blindly.

FYI – PreEmptive’s Dotfuscator tool is a competing product line with a similar feature set that I hope to be covering in a future blog post.

Ignoring obfuscation, these two features are absolutely great for gaining visibility about your application once it has been released.  For all of those teams that aren’t traditional software vendors but building applications for internal use, these are great features for those applications as well.  Software engineering teams building internal applications are very much in need of the same type of information as ISVs about how their internal “customers” are interacting with their applications.  Internal applications don’t necessarily need obfuscation but they can definitely benefit from automated error & feature usage reporting!

One part that I absolutely love about SmartAssembly is that even though the tool instruments and changes your assembly, it also provides the ability to produce a set of matching symbols (.PDBs) that are extremely important for several scenarios in TFS, the Visual Studio ALM family of tools, as well as basic debugging.

I am going to be spending some time in this blog article to walkthrough how to integrate SmartAssembly into your automated TFS build process so that your teams can take advantage of these features.  I am going to take the approach of not creating any custom workflow activities for this particular effort.  Jim Lamb has a good discussion about when to make customizations to the MSBuild file (essentially the Visual Studio project file) and when to make your customizations in the Windows Workflow-based build process template.  As much as I very much prefer customizing my build process templates using custom workflow activities, in this case I choose to do a little customization of both without using any custom workflow activities.  I would much rather have done this using only native Windows Workflow activities but I’ll talk more about that a little later.

Disclaimer:  As a Microsoft MVP, I have been a part of the Friends of Red Gate group for the last four years and I have been provided Not For Resale licenses of the Red Gate family of products though I reserve the right to offer unbiased opinions and criticisms.  I was not paid for these contributions.  However, I may or may not get a complimentary round the next time I see the Red Gaters at the pub in Cambridge. Smile

Works on My Machine LogoWorks on My Machine Disclaimer:  Everything in this blog article works on my machine when I wrote it.  I have the latest version of SmartAssembly and TFS 2010 installed & configured correctly.  I’ve done my best to make this as reusable as possible for most team’s scenarios but I can’t tell you that it will work for you.  Hopefully it gets you started on the right path though!  Please don’t contact me and let me know that my code killed your cat.  I feel for you… I do – I just can’t do anything about it.  You’ve been warned.  I take the same approach that Scott does with blog contributions.

Configuring SmartAssembly for Team Use

SmartAssembly has actually been designed out of the box to handle the single-developer team scenario.  If you are using TFS, you are likely not a single-developer team so you’ll want to a few things to get SmartAssembly setup for use with a team.  The architecture for SmartAssembly can best be described with this architecture diagram:

Smart Assembly Architecture Diagram
Sourcehttp://www.red-gate.com/products/dotnet-development/smartassembly/team-package

You’ll need to get the Professional edition of SmartAssembly since it allows you to store everything in a shared SQL Server database.  One nice thing is that each developer who will need to interact with error & feature usage reports only needs a Developer edition license instead of a full Professional edition license.  You’ll need to install & configure the Professional edition on each of your build servers.  You might as well go ahead and create a build agent tag called “SmartAssembly” to indicate which build agents in your build farm are hosted on servers that have SmartAssembly installed.

When you first start SmartAssembly, you will want to setup the desktop machines & build servers to use the same SQL connection settings for the shared SmartAssembly database.  I even like to use the friendly TFS DNS names that I already have setup for my particular TFS environment.  Remember that if you are using the limited use license of SQL that is included with TFS, you won’t be able to house the SmartAssembly database on that instance.  You’ll need to purchase a legitimate SQL Server license.  It’s a great time to upgrade to the SQL Enterprise edition if you can for TFS!  TFS will definitely take advantage of several of the features.

It is pretty easy to setup from there:

Configuring SmartAssembly Database Connection 

Be sure to also indicate that you want to use relative paths.  Relative paths will be very important when you are using it in a team environment with Team Foundation Server.

BTW, if you need to setup SmartAssembly to use SQL Authentication instead of Windows Authentication, you can do that using this particular article. You do this by basically updating the settings configuration file available on a Windows 7 machine at C:\ProgramData\Red Gate\SmartAssembly\SmartAssembly.settings.

Creating & Storing the SmartAssembly Configuration File in Version Control

I am going to make this easy by just using a quick Windows Forms application however you are able to process any type of assembly including Silverlight apps, ASP.NET web applications, class libraries, etc. using SmartAssembly.

You will want to compile your assembly at least once and then start a new SmartAssembly project.  It actually doesn’t matter where the source & destination location of the assembly is set to in the configuration but you might want to pick a location that all of the developers will be using.  Don’t worry about the build server locations because we will override those later in the build process!  To keep it simple, I’m only going to enable the following features in my SmartAssembly configuration file:

  • Automated Error Reporting,
  • Feature Usage Reporting, and
  • Generate Debugging Information

You can research more on the other options that are available but I am going to keep this walkthrough very simple.  Once you are satisfied with your settings, click the “Save As…” button and save the configuration file in the same folder as your Visual Studio project file.  I even like to include the file in my Visual Studio project so that I can work with it and check it into the version control repository along with the rest of my project.  The SmartAssembly configuration file has a “.saproj” file extension.

Visual Studio Project with Smart Assembly Configuration File

The next thing you might want to do is open the configuration file using the XML Editor in Visual Studio to verify all of the settings look correct. You can use the “Open With…” context menu command from the Solution Explorer window to help you out.

Using the Open With Command in Visual Studio Solution Explorer

The main thing you want to do is be very mindful of using relative file paths everywhere in the configuration file since the location of the source code location changes on the build server & developer machines.  For example, TFS Build allows you to have multiple build agents running on any build server.  I might have three build agents on a build server which means three builds could be running at any given time on the build server.  You isolate each build agent on a build server by setting the working directory to something that will be a unique value.  The default setting is $(SystemDrive)\Builds\$(BuildAgentId)\$(BuildDefinitionName) but I usually change it to $(SystemDrive)\Builds\$(BuildAgentId)\$(BuildDefinitionId) to give me a few extra characters since we also have path length limitations to go up against.

SNAGHTML5088658

Defining Custom MSBuild Properties

At this point, we are going to define a few custom MSBuild properties that we are going to use to trigger the SmartAssembly functionality.  The table lists the properties I am going to define in this process.

Property Name Value(s) Description
TfsBuild True, False Indicates whether this build is occurring using TFS.
RunSmartAssembly True, False Indicates whether the SmartAssembly processing should occur after compilation.
SmartAssemblyConfigurationFileRelativePath <Relative File Path> Stores the relative path location to the .saproj configuration file for the project.

Modifying the Visual Studio Project Files

For many of the common project types, Visual Studio project files are in fact actually MSBuild scripts under the covers.  What we are going to do is add some custom functionality at the end of the project file that we will later “turn on” during the build process.  You could modify this so that you could “turn on” the functionality at development time locally but this additional script excerpt will leave it turned off during normal development.

To edit a Visual Studio Project file, you can “unload” the project from the context menu in Solution Explorer and then double-click it to open it in a new editor document window.  You will add the following excerpt close to the bottom of your Visual Studio project file just before the final </Project> ending tag. In my case it is a .csproj file.

<!-- Red Gate SmartAssembly Custom Post-Compile Processing for TFS Builds -->
<UsingTask TaskName="SmartAssembly.MSBuild.Tasks.Build" AssemblyName="SmartAssembly.MSBuild.Tasks, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7f465a1c156d4d57" Condition="'$(TfsBuild)' == 'True' and '$(RunSmartAssembly)' == 'True'" />
<PropertyGroup Condition="'$(TfsBuild)' == 'True' and '$(RunSmartAssembly)' == 'True'">
  <!-- Uncomment this next line if the configuration file is not located in the same directory and uses the same name as the project. -->
  <!--<SmartAssemblyConfigurationFileRelativePath>SmartAssemblyConfigurationFileName.saproj</SmartAssemblyConfigurationFileRelativePath>-->
  <!-- This will set the default name of the configuration file to the same name as the project name if the property is not defined elsewhere. -->
  <SmartAssemblyConfigurationFileRelativePath Condition="'$(SmartAssemblyConfigurationFileRelativePath)' == ''">$(ProjectName).saproj</SmartAssemblyConfigurationFileRelativePath>
</PropertyGroup>
<Target Name="AfterBuild" Condition="'$(TfsBuild)' == 'True' and '$(RunSmartAssembly)' == 'True'">
  <!-- Archiving the original compiled assembly and matching debugging symbols file. -->
  <Message Text="Archiving the original compiled assembly and matching debugging symbols file." />
  <Copy SourceFiles="@(_DebugSymbolsOutputPath)" DestinationFolder="$(OutDir)Original" Condition="'$(_DebugSymbolsProduced)' == 'true' and '$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)' != 'true'" />
  <Copy SourceFiles="@(MainAssembly)" DestinationFolder="$(OutDir)Original" Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)' != 'true'" />
  <!-- Process Assembly through SmartAssembly -->
  <SmartAssembly.MSBuild.Tasks.Build ProjectFile="$(SmartAssemblyConfigurationFileRelativePath)" Input="@(MainAssembly)" Output="@(MainAssembly)" OverwriteAssembly="True" />
</Target>

It is a modified version of the snippet from the SmartAssembly help documentation for integrating with MSBuild:  http://www.red-gate.com/supportcenter/Content/SmartAssembly/help/6.5/SA_UsingSmartAssemblyWithMSBuild.  You’ll see a little later where we are going to “turn on” the functionality by editing the TFS build process template.  If you named your configuration file the same name as the project name and stored it in the same location in version control you actually don’t need to modify anything in the snippet at all.

Notice that the snippet keeps the original copies of the assemblies and matching symbols (.PDB) file so that they later get copied to the TFS build’s drop folder.  It is copying the original assembly and matching symbols into another subdirectory named “Original” instead of just outputting the SmartAssembly instrumented assembly & matching symbols to a subfolder called “Obfuscated”, “Instrumented”, or “Protected.”  I used to use the latter approach (as some people suggest) but if you are also compiling installers, it is useful to create an installer during specific builds that include the original assemblies instead of the instrumented ones.  In my installer definition (like a WiX file) I’ll just refer to the regular location and it will pickup whatever version the build process created.  If I want an installer to have the original assemblies then I just queue a new build and will set the SmartAssembly process parameter to false for that build.  I don’t have to do anything additional in my WiX definition files to handle this scenario. 

Another side effect you get by using this approach is that if your build process runs any automated tests, static code analysis, test impact analysis, etc., then it will use the instrumented versions of the assemblies as the target of the tests and other post-processing tools!  There are several ways to skin this particular cat but I have fallen back to this approach after a few years of dealing with these issues.

Modifying the Build Process Template in Windows Workflow Foundation

Technically, we could just hard-code the extra MSBuild process parameters that we need using the default TFS build process template on the Process tab of the build definition editor window:

Setting Additional MSBuild Property Values in TFS 2010 Build Definition Editor

If you are okay with this approach then you don’t really need to go any further.  However, we could make this a richer experience for people who will edit and queue these builds from day to day.  This is where we can go through and create a custom process template.

The first thing you will want to do is create a new build process template to start your customizations.  I have included mine for download at the end of this blog post but you may want to walk along.  I usually start by creating a copy of the default build process template available from TFS.  If you aren’t familiar with the basics of this particular process, I would highly suggest going through the walkthrough in either of these books:

You can then change your build definition over to the newly copied build process template using the following combo box.

Selecting a New TFS Build Process Template

If you click on the hyperlink, it will take you to the location in Source Control Explorer where you can get the latest version into your workspace and then open the build process template file for editing in the Windows Workflow Foundation Designer.

Defining Build Definition Process Parameters

The first thing we can do is specify a new build process parameter that is exposed to the end user of the builds by going to the “Arguments” tab in the lower left-hand corner of the Workflow designer.

Arguments Tab for Windows Workflow Designer

I am going to create a Boolean process parameter simply named “RunSmartAssembly” and set the default value to False.  This isn’t an MSBuild property but a workflow process parameter that will be exposed to the end user when they are queuing a new build or when editing the build definition.

Creating New TFS Build Process Parameter

This next step is just to make things that much nicer.  We can give the TFS Build system some additional metadata to make sure the parameter is exposed to the end user in a nice fashion.  There are more details about the process parameter metadata field in either of the book chapters mentioned above in case you would like to learn more!  You edit the collection information for the Metadata parameter that is already defined in the default build process template.  (It’s two above the parameter we created in the previous screenshot.)  Just click the ellipsis button in the default value field column to open up the metadata editor window.

TFS Build Process Parameter Metadata Editor

Fill out the details as indicated above and save your build process template. You won’t see the changes immediately if you were to go back to the build definition editor because we haven’t checked-in the build process template back to the version control repository yet.

Verify SmartAssembly is Installed on Build Server

Whenever I architect a build that requires the use of a custom tool and it isn’t stored in version control (or even if it is but someone forgot to add that workspace mapping) I usually want to add a check in the build process to make sure that the tools are actually available to the build server.  If the check doesn’t locate the tool I have it give a nice build error.

Add an If workflow activity inside the Build Agent Scope activity (labeled “Run on Agent”) but before the section that starts the compilation.  It doesn’t exactly matter where as long as you get them in the agent scope but before any type of compilation begins.  I am going to set my condition to something like the following:

RunSmartAssembly AndAlso Not System.IO.File.Exists(String.Format("{0}\{1}\{2}", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Red Gate\SmartAssembly 6", "SmartAssembly.exe"))

You can then add a Write Build Error activity with an appropriate message to indicate that SmartAssembly was not found.  It should look something along the lines of this following example.

Verifying SmartAssembly is Installed on TFS Build Server

Appending Additional MSBuild Properties

We can now work on passing in the additional MSBuild properties.  I’m going to do this in two steps.  The first step is to append the TfsBuild MSBuild property to the pre-defined workflow variable that is used for this purpose named MSBuildArguments.  I’m going to do this immediately after the workflow activities we added for the previous step using another native primitive workflow activity:  Assign.  It’s a super simple activity that is great for this particular purpose.  The assignment expression that I am going to use for the Value parameter is:

String.Format("{0} {1}", MSBuildArguments, " /p:TfsBuild=True")

image

After that, we will add another If activity where the conditional will be set to the RunSmartAssembly workflow parameter we created earlier.  We will also add add another Assign activity and append our remaining MSBuild property to pass into the compilation process.  You can use this assignment expression for the Value parameter of the Assign activity:

String.Format("{0} {1}", MSBuildArguments, " /p:RunSmartAssembly=True")

The final sequence looks similar to the following screenshot.

image

You may be asking “Why did we define the $(TfsBuild) MSBuild property when we could have just used the $(RunSmartAssembly) property?” That’s a great question… You don’t need it if you aren’t going to do any additional customization. However, in general, I like to always define the $(TfsBuild) MSBuild property so that you could customize the project files to modify the conditions based on whether it is occurring during a TFS Build or if it’s occurring on a developer’s machine. It’s quite handy when you need it.

Notice that we are also performing all of the SmartAssembly processing steps before the Source Server Indexing and Symbol Server Publishing phase of the build process so that both the original symbols and the symbols that match the instrumented assemblies are published correctly to Symbol Server and have the appropriate indexing for Source Server support included in those symbols.  That will be extremely useful later whenever you need to debug against either the original or instrumented assemblies in the future.  You can also open IntelliTrace log files & take advantage of Test Impact Analysis if you keep obfuscation turned off in the SmartAssembly configuration.

Finale

That’s it!  Just save the changes to your build process template and check the file into the version control repository so it can now be used by your build definitions.  Be sure to set your new custom workflow parameter to True and then queue a new build!

Setting Custom SmartAssembly Process Parameter

You’ll now notice that it runs correctly even if you have defined for your build process to compile multiple build configurations (i.e. Debug | x86, Release | AnyCPU, etc.)

Potential Improvement Areas

  • Licensing & Activation for Build Servers – Unfortunately, the way SmartAssembly is licensed you have to purchase a license for each of the build servers you might have and activate the software on those build servers.  The accompanying side effect is that the developer licenses are cheaper.
    This can be problematic in a TFS environment where you might have a build farm that has one build controller with 20 build servers that have three agents on each of those build servers.  It’s not that SmartAssembly would be used at the same time on all 60 of those build agents but you also don’t know which build agent will be reserved for a particular build at any given time.  I have resorted to using the build agent tagging feature of TFS Build to handle making sure particular builds only reserve an agent with SmartAssembly configured & activated.  However, this causes a complete underuse of the hardware resources available in a build farm. 
    I would rather tool vendors achieve their revenue targets by increasing the per-user license fee because and specifically for users who benefit from the advantages that the particular tool brings to them. This licensing model if very similar to how the Visual Studio & third-party components licensing model works.  Microsoft and other third-party component vendors give you the ability to install and use the their tools on a build server without charge.
    I consider build agent machines throw-away machines.  They should remain completely clean but don’t need to be backed up or monitored.  I usually will have a virtual machine base image that has everything already installed & ready to go so that I can add/remove to the build farm “pool” as needed.  I even prefer to throw away machines after 30 days and bring new build agents online to ensure the whole build farm is kept as clean as possible.  When you have tools that require activation & licensing, this scenario quickly becomes problematic.  This leads me to another potential area for improvement.
  • Installation on Build Servers – If you know me well, this is a slightly less critical criticism than the first bullet point but also a pretty big pet peeve of mine. Smile  If you make tools, please don’t require them to be installed on the build server. It’s another thing that has to be kept up to date on potentially many machines and in a base system image.  I would rather be able to check them into a known version control folder and then have the build servers download the latest version during the build process.  There is even a supported mechanism in TFS Build that allows the build controllers & agents to watch for custom assemblies & tools and whenever it notices a new version of those assemblies then it gracefully updates all of the machines in the build farm automatically.  This allows team members to focus & introduce changes to the tools using version control instead of having to update the base image of the build server every time there is a new update.
    You also benefit from having full auditing of what exact tools version were used to produce a specific set of assemblies.  That allows you to potentially recreate a build you created a year ago by simply specifying what version of the source code (including build tools) to use during that build process.
  • Native Workflow Activity for TFS 2010 Build Process Templates -  The process I described in this blog article is definitely much more difficult than what it could be.  Instead of introducing customizations in the MSBuild-portion of the TFS build process, I much rather prefer dropping in a native workflow activity after the compilation process.  SmartAssembly unfortunately doesn’t have a custom TFS build workflow activity at this time.  I would love to see one that allowed me to specify multiple assembly inputs for each build configuration that occurs in the build process and then the appropriate SmartAssembly configuration file for each of the assemblies.  You can do some nice things with it to really make this process super easy.
  • Database Endpoint Instead of a Web Service Layer – SmartAssembly requires the entire team to have access to the centralized database to manage the automated error & feature usage reports.  The software makes direct database calls instead of going through a service layer is which is very different from the way that tools built for TFS are designed in general.  This can be problematic especially if you have TFS setup for your team to be able to access remotely over HTTPS (port 443) without the use of a VPN.  Several IT organizations,really don’t want to open their database ports or even give access to production database instances.  My suggestion would be to have an intermediate service layer that can “integrate” with the existing TFS IIS web sites.  This allows the tool’s service layer to piggy back on the existing infrastructure already setup for TFS.  If you have an SSL certificate and HTTPS configured, then you can take advantage of it.  If you have load balancing setup for scalability, then you could potentially leverage that as well!  We did this with our Notion Timesheet for TFS tools and one of the benefits we end up getting is that we are able to access the service layer from anywhere we can access TFS including over the Public Internet.  No worries about giving people access to the SQL Server instance as well.
  • Source Server Support – This isn’t necessarily a TFS-specific topic but really something for anyone using build servers & Source Server indexing.  When you compile on a build server, the location of the source code is included in the symbol information.  Your developers will normally not download the source code to the same location as other developers and particularly not the same location that the build server does since that changes depending on what TFS build agent is used on a build server for any particular TFS build.  Source Server Indexing helps to combat this particular problem by replacing the physical location with the location in the version control repository including the branch and version of the code used.  SmartAssembly has a feature that allows you to review details of stack trace, object values, etc. when you open an error report.  However, it doesn’t use the Source Server information even if it is stored in the symbol files.  This is particularly a problem when you are in a TFS environment and using automated builds.  SmartAssembly just ignores those additional streams in the symbols file.  SmartAssembly should use the Source Server information if it exists in the symbols to pull the appropriate version of source code from the version control repository.  (Red Gate Support Ticket Number:  F0041570)
  • Additional ALM Integration with TFS – There are so many different areas where SmartAssembly could shine if it had some additional ALM-specific integration with TFS!

Download Process Template

If you are interested in downloading the completely customized version of the build process template, I have included a link to it below.

Download SmartAssembly Process Template

 

 

Take care,

Ed Blankenship



Blog Site Theme Update



For the folks that are using an RSS reader, you might not have noticed the quiet update on the EdSquared.com site’s blog theme.  It sure does make your day that much better when things are feeling a lot better on your site.  A fresh & new blog design is one way you can brighten your day!

I just wanted to mention that Jeremy Kratz does some really great work and was very much a pleasure to work with.  His portfolio includes some other great work like Stack Overflow and Scott Hanselman’s blog site.

Some of the large goals I had were mainly around:

  • Great Reading Experience for Mobile Devices
  • New Standards-Compliance
  • Looking the Same Across All Modern Browsers & Versions
  • Ability to Easily Make Modifications for Static Content in the Future

One of the side effects of this work is that those heading to the site using Internet Explorer 6 have a horrible experience.  I’m okay with that.  IE6 users probably know that they need to be getting over to a modern browser already. Smile  Thankfully – I don’t have that many folks using IE6 so thank you for making that decision easy.  According to recent metrics, it’s not even in the top 10 and it’s only 0.66% of page views.

EdSquared - Browser Version Percentages

EdSquared - Browser Version Percentages Pie Chart

Hope you end up liking it!

Ed Blankenship



Deploying Visual Studio 2008 ClickOnce Projects in TFS 2010 Build



I wanted to wring my hair on this one… but it was actually rather simple to get solved.  I’m helping a customer this week upgrading their server to TFS 2010 from TFS 2008.  They had TFS 2008 builds compiling & publishing Visual Studio 2008 solutions & builds.  When you upgrade to TFS 2010, those existing build definitions will end up using the UpgradeTemplate.xaml build process template in TFS 2010.  Not a problem there.  This customer was not able to upgrade their solutions & projects immediately to Visual Studio 2010 in tandem with the TFS 2010 upgrade.  That should normally not be a problem but having done a few of these upgrades, I know that I usually need to set out some time just to get the existing builds working again.  There’s always something wrong. Smile  Never huge but enough to irritate you after an upgrade.

We went through a few hurdles to get those solutions & projects compiling and then we moved on to the deployment builds.  They seemed to just work which was great!  In their legacy TFSBuild.proj files, they had an entry in the AfterCompile MSBuild target essentially like this:

<MSBuild Projects="$(SolutionRoot)\Branch\ClickOnceProject.csproj" 
Properties="PublishDir=\\FILESERVER\ClickOncePublishPath\;ApplicationVersion=$(VersionNumber);"
Targets="Publish" />

It was great until we went to go actually fire up the app… CRASH!  It is complaining in the ClickOnce deployment log that the deployment manifest wasn’t semantically valid and that the deployment manifest was missing the <compatibleFrameworks> node.  Here’s the full (redcated) log: (emphasis mine)

PLATFORM VERSION INFO
    Windows             : 6.1.7601.65536 (Win32NT)
    Common Language Runtime     : 4.0.30319.239
    System.Deployment.dll         : 4.0.30319.1 (RTMRel.030319-0100)
    clr.dll             : 4.0.30319.239 (RTMGDR.030319-2300)
    dfdll.dll             : 4.0.30319.1 (RTMRel.030319-0100)
    dfshim.dll             : 4.0.31106.0 (Main.031106-0000)

SOURCES
    Deployment url            :
http://webserver/ClickOnceProject.application
                        Server        : Microsoft-IIS/6.0
                        X-Powered-By    : ASP.NET
    Application url            :
http://webserver/Application%20Files/ClickOnceProject_1_1_1_1/ClickOnceProject.exe.manifest
                        Server        : Microsoft-IIS/6.0
                        X-Powered-By    : ASP.NET

IDENTITIES
    Deployment Identity        : PolicyManagement.application, Version=1.11.1026.3, Culture=neutral, PublicKeyToken=3801d6f74f2e8cd7, processorArchitecture=x86
    Application Identity        : PolicyManagement.exe, Version=1.11.1026.3, Culture=neutral, PublicKeyToken=3801d6f74f2e8cd7, processorArchitecture=x86, type=win32

APPLICATION SUMMARY
    * Online only application.
    * Trust url parameter is set.
ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of http://webserver/ClickOnceProject.application 
resulted in exception. Following failure messages were detected:
        + Deployment manifest is not semantically valid.
        + Deployment manifest is missing <compatibleFrameworks>.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [10/26/2011 1:49:41 PM] : Activation of
http://webserver/ClickOnceProject.application has started.
    * [10/26/2011 1:49:42 PM] : Processing of deployment manifest has successfully completed.
    * [10/26/2011 1:49:42 PM] : Installation of the application has started.
    * [10/26/2011 1:49:42 PM] : Processing of application manifest has successfully completed.

ERROR DETAILS
    Following errors were detected during this operation.
    * [10/26/2011 1:49:43 PM] System.Deployment.Application.InvalidDeploymentException (ManifestSemanticValidation)
        - Deployment manifest is not semantically valid.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.PlatformDetector.VerifyPlatformDependencies(AssemblyManifest appManifest, AssemblyManifest deployManifest, String tempDir)
            at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
            at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
        --- Inner Exception ---
        System.Deployment.Application.InvalidDeploymentException (InvalidManifest)
        - Deployment manifest is missing <compatibleFrameworks>.
        - Source:
        - Stack trace:


COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.

Now what I remember is that the <compatibleFrameworks> node was actually introduced in the deployment manifests for .NET / ClickOnce 4.0 in Visual Studio 2010 and we shouldn’t be expecting them for Visual Studio 2008 ClickOnce projects.  Sounds like the build process is not picking up the right version.  In the TFS 2010 version of the TeamFoundationBuild.targets file, it handles compilation correctly by setting the appropriate MSBuild tools version number.  Why wasn’t it picking that up for our publish?

Oh yeah… since TFS 2010 build had to specify it for the legacy UpgradeTemplate.xaml and TeamFoundationBuild.targets files, we have to do the same thing.  Duh.  It ended up being an easy fix and we just updated that portion of the legacy TFSBuild.proj build script to explicitly set the MSBuild tools version and pass in the framework version as well for the ClickOnce project.

<MSBuild ToolsVersion="3.5" Projects="$(SolutionRoot)\Branch\ClickOnceProject.csproj"
Properties="ClrVersion=2.0.50727.0;PublishDir=\\FILESERVER\ClickOncePublishPath\;ApplicationVersion=$(VersionNumber);"
Targets="Publish" =""/>

BTW – you can do this in the new Windows Workflow-based build process templates as well but instead you would use the MSBuild workflow activity.

image

However, I would highly suggest upgrading to Visual Studio 2010 when you get a chance since it will handle ClickOnce projects that target .NET 2.0, .NET 3.0, .NET 3.5, and .NET 4.0 seamlessly.

Now that all of the legacy TFS 2008 builds are working in TFS 2010, it’s time to start helping my current customer get their Visual Studio 2008 solutions & projects upgraded to Visual Studio 2010 and leverage the new Windows Workflow-based build process template!

 

Ed Blankenship

Many thanks to Josh Winfree for helping out with the discover of this one!



Free ALM Roadshow Events in 2011



I’m pretty happy to be heading out in a few weeks to lead a few ALM Road Show Events around the US.  There’s actually several more that are going to be led by others on the Imaginet ALM team (Dave McKinstry & Anna Russo) so find one that’s close to you and bring your questions!  I’ll be leading the ALM Road Show events in:

  • Boston, MA
  • Atlanta, GA
  • Dallas, TX
  • Houston, TX

Here’s the full list of the Roadshow Events:

Visual Studio 2010 ALM Tools Live Roadshow
October 27,2011
Microsoft Corporation
St.Louis, MO

Visual Studio 2010 ALM Tools Live Roadshow
October 28, 2011
Microsoft Corporation
Columbus, OH

Visual Studio 2010 ALM Tools Live Roadshow
November 2, 2011
Microsoft Corporation
Salt Lake City/Lehi, UT

Visual Studio 2010 ALM Tools Live Roadshow
November 3, 2011
Microsoft Corporation
Irvine, CA

Visual Studio 2010 ALM Tools Live Roadshow
November 8, 2011
Microsoft Corporation
Presenter:  Ed Blankenship
Waltham, MA

Visual Studio 2010 ALM Tools Live Roadshow
November 9, 2011
Microsoft Corporation
Presenter:  Ed Blankenship
Alpharetta, GA

Visual Studio 2010 ALM Tools Live Roadshow
November 29, 2011
Microsoft Corporation
Presenter:  Ed Blankenship
Dallas/Irving, TX

Visual Studio 2010 ALM Tools Live Roadshow
November 30, 2011
Microsoft Corporation
Denver, CO

Visual Studio 2010 ALM Tools Live Roadshow
December 1, 2011
Microsoft Corporation
Presenter:  Ed Blankenship
Houston, TX

If you can’t visit us at the local ALM Roadshow events, try out some of the ALM Webcasts we are doing!  Dave McKinstry has a full write up of each of them available here:  http://weblogs.asp.net/dmckinstry/archive/2011/10/13/upcoming-free-vs-alm-webcasts.aspx

Test Management in Agile Teams
October 24, 2011
Free Online Workshop
1:00-2:00pm (CST)

Manual Testing in Agile Teams
October 26, 2011
Free Online Workshop
1:00-2:30 (CST)

Testing in an Agile Team
November 1, 2011
Free Online Workshop
1:00-2:30pm (CST)
Automated Load and UI Testing for SharePoint Projects
December 6, 2011
Free Online Workshop
1:00-2:30pm (CST)

Testing with SharePoint Projects
December 12, 2011
Free Online Workshop
1:00-2:30pm (CST)

Using Lab Management with SharePoint Development
December 13, 2011
Free Online Workshop
1:00-2:00pm (CST)
Automated Load and UI Testing for SharePoint Projects
December 20, 2011
Free Online Workshop
1:00-2:30pm (CST)

 

Take care and hope to see you there!

Ed Blankenship

Posted in Community | Speaking | TFS | VSTS


August 2011 – New TFS 2010 Power Tools Released



A new TFS 2010 Power Tools release is now available!  As always, I recommend that all team members (including those with only Team Explorer installed) to have the latest version of the TFS 2010 Power Tools installed.

I won’t go into too many details about all of the new features since Brian Harry has done a great job of explaining each of the new features in the release on his blog.  There are a few that are worth noting though!

One of the new features is “Rollback of a Changeset” in the Team Explorer UI.  You have been able to rollback a changeset in TFS 2010 without the Power Tools but it was something that you had to do from the command-line.  Another handy feature is comparing two build definition’s using the tfpt.exe builddefinition /diff tool that is now available.  You can also use tfpt.exe builddefinition /dump to give you a nice listing of all of a build definition’s details.

If you hated having to uninstall a Power Tools release before you could install a new version in the past, we don’t have to worry about it any longer!  You can now fire up the installer for newer versions and it will upgrade the previous version appropriately.  No excuses now for not having the latest version installed. Smile

For all of those that wished they could just search through some work items, we finally have “the search box” that we have all been waiting for!  Look at the help file (C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools\Help\WorkItemSearch.mht) for some interesting tricks & tips you can use to make searching for work items quicker for you.

Ed Blankenship

Posted in TFS | Tools | VSTS


Speaking at Austin TFS User Group – Customizing TFS Builds



I’m pretty excited about being in Austin this week (one of my favorite cities) and while I’m here, I’m going to be speaking at the Austin TFS User Group this Thursday night.  Here are some more details:
Special Event: TFS 2010 Build Customization with Ed Blankenship

Date: Thursday, August 4th, 6:30 to 8 PM at Overwatch Systems, 5301 SW Parkway

To attend please register at: http://tfsaustinbuild.eventbrite.com/

Don't miss this one-time event and deep dive on "Customizing the Build Process with TFS 2010 Build and Workflow Foundation." In TFS 2010, the automated build infrastructure has been revamped to use Windows Workflow Foundation (WF) instead of MSBuild. Ed will present and answer questions on how to customize the default build process template and how to leverage multiple aspects of the workflow implementation for TFS 2010 Build.

Location:

Overwatch Systems, 6:30 to 8 PM

NOTE: park in the parking garage, signs will direct you to the meeting

5301 Southwest Parkway

Austin, TX 78735

 

Looking forward to seeing everywhere in the area there!

Ed Blankenship



First Release of Community TFS Build Extensions



Wow – I’ve been seeing the discussions in the last few weeks from the team members but I’m happy to announce that they have done a great job and released the first release of the Community TFS Build Extensions on CodePlex!  There have been several months of effort put into putting this collection together and you’ll see some of the best contributors that are available.   You’ll find all sorts of custom build activities and there are many more included on the backlog.  Be sure to vote for you favorite.  The best part of this CodePlex project is that the source code is fully available for your use internally.

Release Notes

  • This is our first Stable release providing in the region of 100 Activities / Actions
  • This release contains assemblies and a CHM file.
  • We anticipate shipping every 2 to 3 months with ad-hoc updates provided to the documentation.
  • We welcome your candid and constructive feedback and look forward to improving the quality with and for you.
  • Please use the Discussion and Issue Tracker tabs for providing feedback.

The Visual Studio ALM Rangers have also released a set of guidance documents for customizing builds in TFS 2010 including the use of the Community TFS Build Extensions.  Check out more details here:  http://blogs.msdn.com/b/willy-peter_schaub/archive/2011/06/17/toc-build-customization-guide-blog-posts-and-reference-sites.aspx

If you are looking for a book with information about how to customize build definitions, check out Professional Team Foundation Server 2010 as well which goes through one example which uses an activity from the Community TFS Build Extensions to stamp the version number on assemblies.

 

Ed Blankenship