Microsoft Acquires devBiz, Makers of TeamPlain Web Access#
Monday, March 26, 2007 10:19:35 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Announcing the Chicago VSTS Users Group#

 

 

Join us for the maiden voyage of the Chicago Visual Studio Team System User group!

Microsoft Visual Studio 2005 Team System is the best integrated software development platform to build the mission-critical applications that businesses depend on. It extends Visual Studio's integrated and productive experience from the developer to the entire development team by delivering powerful new role-based tools for software architects, developers, testers and project managers. It also includes an integrated team server and customizable processes to help teams drive predictability, visibility, and control into their software development process.  Join us each month for new topics including how the different role based editions can help your team to finish your projects on time, on scope and on budget, dive into the many features included in the powerful and robust Team Foundation Server product, or speak to one of the many partners who have extended the platform to enable continuous integration scenarios, integrate into Microsoft outlook, even an Eclipse plug-in! 

Agenda for April 11th meeting:

  • 6:00pm - 6:30pm Welcome, Introductions and Pizza
  • 6:30pm - 8:30pm What is Visual Studio Team System?
  • 8:30pm - 9:00pm Q&A, Raffle and Wrap Up

Click here to register

You may also access the registration site at: www.microsoft.com/events and reference Event ID 1032333482

Wednesday, March 14, 2007 6:35:41 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Team Foundation Power Tools v1.2 Released#

Team Foundation Server is happy to announce the release of version 1.2 of Team Foundation Power Tools (formerly known as Power Toys).  In this release we've added 2 new command line tools for the developer and 3 non-command line tools.   This version includes some bug fixes to previous Power Tools, support for Vista, and adds the following new functionality:

  • Workspace Command (tfpt.exe) - Use the workspace command for additional workspace operations not supported in the currently shipping Team Foundation Server command line (tf.exe).
  • Treeclean Command (tfpt.exe) - Use the treeclean command to see and optionally delete files in the current directory and all subdirectories that are not under version control.
  • Process Template Editor - A tool to provide UI for authoring work item types and some of the associated Process Template components. 
  • Check-in Policy Pack - A set of handy check-in policies to address needs customers have expressed.
  • Build Test Tools Task - A tool that allows running unit tests by simply specifying the DLLs or even specifying a file name pattern in TfsBuild.proj, instead of using .vsmdi files to specify tests to run.

Please note that the Process Template Editor has some additional pre-requisites, they are identified on the download page. 

You can locate the Team Foundation Power Tools V1.2 release here and you can get help on the forums for these tools here.

Wednesday, February 21, 2007 9:02:02 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

VSTS Case Studies#

From time to time I am asked where one can get their hands on case studies around VSTS. You can find all VSTS case studies here: http://msdn2.microsoft.com/en-us/teamsystem/aa718812.aspx. Today we just released two new case studies focused around ROI.

Tuesday, February 13, 2007 5:53:07 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

VSTS Books#
Visual Studio Team System Chat - Wed, Nov 8th#

Join members of the Visual Studio Team System product group to discuss features available in Visual Studio Team Foundation Server, Team Editions for Architects, Developers, Database Pros, and Testers. In addition, discuss what's new in the latest Community Technology Preview (CTP).

Join the chat on Wednesday, November 8th, 2006 from 10:00am - 11:00am Pacific Time.

Add to Calendar

Additional Time Zones

Tuesday, November 07, 2006 7:51:38 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

TfsAlert and Security#

After releasing TfsAlert 0.3.0.0 I realized I'd failed to mention how security works.  BIG OPPS, Sorry!!!  TfsAlert will not get into the business of managing your user account.  Windows already provides such a facility and I believe leveraging that is just a better more secure choice.  However TfsAlert will maintain knowledge about your TfsUserName.  It does so to properly create the Tfs event subscription.  Having said that you still need to properly authenticate just to subscribe, no different than any of the other Tfs tools.

So how do we manage security?  Simple, we just add the server\username \ password into Control Panel -> User Accounts -> Manage User Accounts -> Advanced -> Manage Passwords.  I do realize this may be shut down by a companies GPO but if not we have found this to work very nicely.  If your one of those people ( like I ) who use multiple Tfs servers at a variety of locations you would always be prompted for your credentials just to start up the IDE.  This all goes away once your account is loaded into that Windows facility.

Sunday, November 05, 2006 9:13:18 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Build Status TFS Policy, Part II#

Since my post yesterday I just decided to update the code and also include Buck's comments.  I even added a simple installer as a bonus since that last post was just useless.  Here is the new version and this time in a zip ;)

Microsoft.Services.TfsPolicies-installer.zip (159.25 KB)

Microsoft.Services.TfsPolicies-source.zip (37.17 KB)
Friday, October 27, 2006 12:56:05 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Stop, the build is broken!!#

It's late, your tired and yet somehow you got stuck fixing the build because junior engineer bob just fired off a check-in and took off.  It looks like the build is now broken because junior hasn't done a get latest in a month.  In the meantime 10 other people check-in and just end up compounding the problem.

Unfortunately things like this happen.  One day I just got so frustrated, I just wrote a custom TFS check-in policy which gets the last build status and validates a particular build type was actually passing before you check-in.  I started with Jeff Atwood and James Manning posts where they have done a great job explaining how to write a simple custom check-in policies.

Let's Code!!

There are two things you have to do for any check-in policy, define the policy and configure it.  This sample isn't much different than the code comment examples. 

First lets look at the policy definition. The real work is in the Evaluate method.  This is where we call TFS and find out what state the build is in. This sample could further be updated and remove the requirement to configure the TfsServer.  You can actually get that info from the workspace IPendingCheckin supplied in Initialize() (_pendingCheckin.PendingChanges.Workspace).  From the Workspace object, it’s workspace.VersionControlServer.TeamFoundationServer.

using System;
using System.Diagnostics;
using System.Windows.Forms;
using Microsoft.TeamFoundation.VersionControl.Client;

using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Build.Proxy;
using System.Text;

namespace Microsoft.Services.TfsPolicies
{
    [Serializable]
    public class BuildStatusPolicy : PolicyBase
    {
        string _tfsServer = @"http://TFSServer:8080";
        string _tfsProject = "TfsProject";
        string _buildType = "BuildType";

        [NonSerialized]
        protected bool _disposed = false;
        [NonSerialized]
        protected IPendingCheckin _pendingCheckin;

        //public virtual event PolicyStateChangedHandler PolicyStateChanged;

        #region IPolicyDefinition

        public override string Description
        {
            get { return Strings.PolicyDescription; }
        }

        // This string is a description of the type of our policy.  It will be displayed to the
        // user when they select our policy type in the list of policies installed on the system
        // as mentioned above.
        public override string TypeDescription
        {
            get { return Strings.PolicyTypeDescriptions; }
        }

        // This string is the type of our policy.  It will be displayed to the user in a list
        // of all installed policy types when they are creating a new policy.
        public override string Type
        {
            get { return Strings.PolicyType; }
        }

        // This is a string that is stored with the policy definition on the source
        // control server.  If a user does not have our policy plugin installed, this string
        // will be displayed.  We can use this as an opportunity to explain to the user
        // how they might go about installing our policy plugin.
        public override string InstallationInstructions
        {
            get { return Strings.PolicyInstallInstructions; }
        }

        public override bool CanEdit
        {
            //TODO maybe check the role of the user trying to change?
            get { return true; }
        }

        #endregion //IPolicyDefinition

        #region IPolicyDefinition

        public override void Initialize(IPendingCheckin pendingCheckin)
        {
            if (_pendingCheckin != null)
            {
                throw new InvalidOperationException("Policy already initialized.");
            }

            if (_disposed)
            {
                throw new ObjectDisposedException(null);
            }

            _pendingCheckin = pendingCheckin;

            pendingCheckin.PendingChanges.CheckedPendingChangesChanged += new EventHandler(pendingCheckin_CheckedPendingChangesChanged);
        }

        // This method is invoked by the policy framework when the user creates a new checkin
        // policy or edits an existing checkin policy.  We can use this as an opportunity to
        // display UI specific to this policy type allowing the user to change the parameters
        // of the policy.
        public override bool Edit(IPolicyEditArgs policyEditArgs)
        {
            if (_pendingCheckin != null)
            {
                throw new ApplicationException("The policy can't be edited after it has been initialized for evaluation.");
            }

            using (BuildStatusPolicyConfiguration buildStatusPolicyConfiguration = new BuildStatusPolicyConfiguration(_tfsServer, _tfsProject, _buildType))
            {
                DialogResult formResult = buildStatusPolicyConfiguration.ShowDialog(policyEditArgs.Parent);

                if (formResult == DialogResult.OK)
                {
                    _buildType = buildStatusPolicyConfiguration.TfsBuildType;
                    _tfsProject = buildStatusPolicyConfiguration.TfsProject;
                    _tfsServer = buildStatusPolicyConfiguration.TfsServer;

                    return true;
                }
                return false;
            }
        }

        public override PolicyFailure[] Evaluate()
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(null);
            }
            
            TeamFoundationServer teamFoundationServer = TeamFoundationServerFactory.GetServer(_tfsServer);
            BuildStore buildStore = teamFoundationServer.GetService(typeof(BuildStore)) as BuildStore;

            BuildData[] buildData = buildStore.GetListOfBuilds(_tfsProject, _buildType);

            BuildData lastBuild = this.getLastBuild(buildData);

            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("Builds Returned: {0} \n", buildData.Length.ToString());
            sb.AppendFormat("Build Status: {0} \n", lastBuild.BuildStatus);
            sb.AppendFormat("Build Status ID: {0} \n", lastBuild.BuildStatusId);
            sb.AppendFormat("Finish Time: {0} \n", lastBuild.FinishTime);
            sb.AppendFormat("Build Number: {0} \n", lastBuild.BuildNumber);

            EventLog.WriteEntry("Microsoft.Services.TfsPolicies", sb.ToString());

            if (lastBuild.BuildStatus.Equals("Failed", StringComparison.OrdinalIgnoreCase))
            {
                return new PolicyFailure[] { new PolicyFailure(string.Format(Strings.PolicyPrompt, _buildType), this) };
            }
            else
            {
                return new PolicyFailure[0];
            }
        }

        // This method is called if the user double-clicks on a policy failure in the UI.
        // We can handle this as we please, potentially prompting the user to perform
        // some activity that would eliminate the policy failure.
        public override void Activate(PolicyFailure failure)
        {
            MessageBox.Show(string.Format(Strings.PolicyPrompt, _buildType), "How to fix your policy failure");
        }

        // This method is called if the user presses F1 when a policy failure is active in the UI.
        // We can handle this as we please, displaying help in whatever format is appropriate.
        // For this example, we'll just pop up a dialog.
        public override void DisplayHelp(PolicyFailure failure)
        {
            MessageBox.Show(string.Format(Strings.PolicyDisplayHelp, _buildType), "Prompt Policy Help");
        }

        #endregion IPolicyDefinition

        private void pendingCheckin_CheckedPendingChangesChanged(Object sender, EventArgs e)
        {
            if (!_disposed)
            {
                OnPolicyStateChanged(Evaluate());
            }
        }

        private BuildData getLastBuild(BuildData[] builds)
        {
            DateTime lastBuildDateTime = builds[0].FinishTime;

            int position = 0;

            for (int i = 0; i < builds.Length; i++)
            {
                if (builds[i].FinishTime > lastBuildDateTime)
                {
                    lastBuildDateTime = builds[i].FinishTime;
                    position = i;
                }
            }

            return builds[position];
        }
    }
}

 

Now lets configure it.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Microsoft.Services.TfsPolicies
{
    public partial class BuildStatusPolicyConfiguration : Form
    {
        public BuildStatusPolicyConfiguration(string TfsServer, string TfsProject, string TfsBuildType  )
        {
            InitializeComponent();

            txtTfsUrl.Text = TfsServer;
            txtTfsProject.Text = TfsProject;
            txtTfsBuildType.Text = TfsBuildType;

            this.txtTfsBuildType_TextChanged(null, null);
            this.txtTfsProject_TextChanged(null, null);
            this.txtTfsUrl_TextChanged(null, null);
        }

        public string TfsServer
        {
            get { return this.txtTfsUrl.Text; }
        }

        public string TfsProject
        {
            get { return this.txtTfsProject.Text; }
        }

        public string TfsBuildType
        {
            get { return this.txtTfsBuildType.Text; }
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        private void txtTfsUrl_TextChanged(object sender, EventArgs e)
        {
            btnOK.Enabled = txtTfsUrl.Text != string.Empty;
        }

        private void txtTfsProject_TextChanged(object sender, EventArgs e)
        {
            btnOK.Enabled = txtTfsProject.Text != string.Empty;
        }

        private void txtTfsBuildType_TextChanged(object sender, EventArgs e)
        {
            btnOK.Enabled = txtTfsBuildType.Text != string.Empty;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}

Lastly I dropped the strings into their own struct.

using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Services.TfsPolicies
{
    internal struct Strings
    {
        internal const string PolicyDescription = "Stop users from checking in when the configured BuildType is in a 'Failed' status.";
        internal const string PolicyTypeDescriptions = "This policy will prompt the user to decide whether or not they should be allowed to check in based on the build status.";
        internal const string PolicyType = "Check for passing build";
        internal const string PolicyInstallInstructions = "Please install the package Microsoft.Services.TfsPolicies.Setup.msi.";
        internal const string PolicyPrompt = "Please wait to check-in until the {0} build is passing";
        internal const string PolicyDisplayHelp = "This validates the {0} build status is not in failure";
    }
}

One thing to note, be aware of performance.  This just does the mechanics and is not optimized.  During the course of a check-in this will actually call the web service a number of different times.  On top of that the web service endpoint only returns all build results for a build type rather than just the last one.  So depending on your team size etc. you've now been warned.  Sometimes a performance hit is worth the productivity gained.

Thursday, October 26, 2006 9:26:45 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Visual Studio Team System Chat - Wed, Nov 8th#

Join members of the Visual Studio Team System product group to discuss features available in Visual Studio Team Foundation Server, Team Editions for Architects, Developers, Database Pros, and Testers. In addition, discuss what's new in the latest Community Technology Preview (CTP).

Join the chat on Wednesday, November 8th, 2006 from 10:00am - 11:00am Pacific Time.

Add to Calendar

Additional Time Zones

Wednesday, October 25, 2006 6:37:53 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Team Foundation Power Toys#

The other day I was asked the questions: 

  • Can I rollback a Changeset?
  • Can I produce a list of items I changed while I was offline?

Of course you can, but you need to use Team Foundation Power Toys or tfpt.exe.  This utility can be found in the Visual Studio 2005 SDK of which you can download at http://www.vsipmembers.com/.  Once the SDK is installed you will find tfpt.exe at %ProgramFiles%\Visual Studio 2005 SDK\2006.06\VisualStudioTeamSystemIntegration\Utilities\Team Foundation Power Toys

Features include ( The following was taken straight from the tfpt.exe's ReadMe.doc found in the SDK. )

  • Unshelve (Unshelve + Merge)   
    •  The unshelve operation supported by tf.exe does not allow shelved changes and local changes to be merged together. TFPT’s more advanced unshelve operation allows this to occur under certain circumstances.
  • Rollback
    • Sometimes it may be necessary to undo a checkin of a changeset. This operation is directly not supported by Team Foundation, but with the TFPT rollback tool you can pend changes which attempt to undo any changes made in a specified changeset.  Not all changes can be rolled back, but in most scenarios the TFPT rollback command works. In any event, the user is able to review the changes that TFPT pends before checking them in.
  • Online
    •  With Team Foundation, a server connection is necessary to check files in or out, to delete files, to rename files, etc. The TFPT online tool makes it easier to work without a server connection for a period of time by providing functionality that informs the server about changes made in the local workspace.
  • GetCS (Get Changeset)
    • The TFPT GetCS tool gets all the items listed in a changeset at that changeset version.
    • This is useful in the event that a coworker has checked in a change which you need to have in your workspace, but you cannot bring your entire workspace up to the latest version. You can use the TFPT GetCS tool to get just the items affected by his changeset, without having to inspect the changeset, determine the files listed in it, and manually list those files to a tf.exe get command.
  • UU (Undo Unchanged)
    • The TFPT UU tool removes pending edits from files which have not actually been edited.

 

Wednesday, June 21, 2006 8:37:18 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

What is a Team Project?#

I have now installed and used TFS at a number of clients.  On every installation the very first question asked has alway been, what is a project?  This question seems to provoke a solid hour of conversation about organization structure and development practices.  No doubt every shop will always be different, regardless you will still derive from some base.  Last night while browsing around on MSDN, I ran across the official "project" party line.  Below is just a snippet from Team Foundation Team Projects.

The Logical Definition of a Team Project

Logically (or conceptually), a team project is a single infrastructure that encompasses all of the separate tools and elements used in the life cycle of the development of a software application. Each software application, or "team project," in development is virtually grouped in its own namespace intended solely for the team project. Therefore, a team project is simply a container isolating all of the tools and artifacts associated with a particular software application in development, such that all other team projects will not have access to those tools or artifacts (for example, source code, work items, and documents).

The team project is the central concept that holds together the team endeavor of creating a specific software technology or product. The team project is the virtual collection of artifacts relevant to a software application on which a team is working. For the team members, the team project concept eliminates the problem of having access to multiple artifacts not relevant to the team project; such an excess of artifacts causes confusion and delays the software development process. At a minimum, the team project consists of a set of tools and artifacts. The team project may also include source control policies, a team project reporting site, and a team project portal. The Team Foundation team project allows the process template, during the creation of a team project, to select which tools are relevant and will be added in the team project container.

The team project concept enhances reporting across all the tools used by the team. In the past, cross-tool reporting was challenging because the data from different tools was not related. For example, if a software developer wanted to obtain a cross-tool report on defects, he or she would have to distinguish the defects from multiple projects, since the defects were all stored in a common location. A team project is created in a namespace containing only tools and artifacts relevant to the software project; therefore a common filter is created which can relate different artifacts from different tools.

A single Team Foundation Server server may contain multiple team projects, each of which are created in a separate namespace, such that a document named X in namespace A is not the same as a document named X in namespace B. Creating a team project in a separate namespace allow artifacts or tools to be unique to the team project for which they belong, such that a tool or artifact contained in team project A is not accessible to a software developer working on team project B.

MSDN | Team Foundation Team Projects, http://msdn2.microsoft.com/en-us/library/ms181234(VS.80).aspx

Tuesday, May 23, 2006 9:05:46 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Teamprise 1.0 Released#

Let's face it if you are on a big enterprise development project you most likely will have both platforms, Java and .Net.  I am a big fan when it comes to using the right tool for the job.  I have been lucky enough to see Teamprise in action on some heterogeneous projects I have been on.  It's great to see a product like it harness the power and vision of the TFS platform.

Nice job goes out to the staff at Teamprise!

Tuesday, April 11, 2006 5:06:39 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Visual Studio Source Control Undelete Configuration Check-box#

It's been a while since my last post but I had an opportunity to take a month of vacation when my child was born.  Let me just say, it sure didn't feel like a month.

Yesterday I stumbled across some IDE source control configuration gem.  While poking around in I ran across "Show deleted items in the Source Control Explorer" in Tools -> Options -> Source Control -> Visual Studio Team Foundation Server.  I can't tell you how many times I have been through those options but apparently I just ignored that whole section since it has the proxy server inputs above it.  Once checked you will be able to use the undelete features from within the IDE rather than tf.exe.

Tuesday, April 11, 2006 1:22:24 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

TFS RTM'd#

It's official, TFS has RTM'd.  Jeff gives more detail about it.

Congratulations to everyone on the TFS team for a job well done!  Many congratulations and thanks to all of our partners and customers who have helped make this a success.

Friday, March 17, 2006 5:04:38 PM (Central Standard Time, UTC-06:00) #    Comments [1]  | 

 

WIQL List Separator and the TFS Release Candidate#

This past release of TFS brought us the much needed friendly names in the Team Foundation Client user drop down lists.  Before that change, your WIQL query may have looked like this:

<Wiql>
    SELECT [System.Id], [System.Title]
    FROM WorkItems WHERE [System.TeamProject] = @project
    AND [System.AssignedTo] IN ('UserIdA', ''UserIdB')
    ORDER BY [System.Id]
</Wiql>

As you can see we are searching for any Work Item assigned to UserIdA and UserIdB.  The user list is delimited by a comma ( this will become important later ).  After the release canidate release that same query may now look like the following:

<Wiql>
    ...
    AND [System.AssignedTo] IN ('FirstNameUserA LastNameUserA', 'FirstNameUserB LastNameUserB') 
    ...
</Wiql>

The only change to this query was the replacement of the alias with the users First Name Last Name.  This query assumes your Active Directory is setup to display First Name Last Name rather than Last Name, First Name.  If your Active Directory is setup like the latter then your query will look like:

<Wiql>
    ...
    AND [System.AssignedTo] IN ('LastNameUserA, FirstNameUserA', 'LastNameUserB, FirstNameUserB') 
    ...
</Wiql>

With that setup the name actually introduces a comma which invalidates the list separator.  This query is now broken.  All is not lost. 

We can change the List Separator from a comma to a semi colon. Control Panel -> Regional and Language Options -> Customize, on the numbers tab and you will find the List Separator setting.  Do realize this change may adversely effect other applications which may use the List Separator.

 

 

Your query will now change as follows:

<Wiql>
    ... 
    AND [System.AssignedTo] IN ('LastNameUserA, FirstNameUserA'; 'LastNameUserB, FirstNameUserB') 
    ...
</Wiql>

Wednesday, February 15, 2006 7:44:17 PM (Central Standard Time, UTC-06:00) #    Comments [2]  | 

 

VSTS Jumpstart, things you will end up asking for#
Internet Links
Visual Studio Team System Home
Getting Started with Team Foundation
MSDN Technical Forums
VSTS Downloads
Team System Rocks
How To Links
Visual Studio Team System Install Guide
TFS Warehouse Troubleshooting
Step-By-Step Guide to Converting Web Projects from Visual Studio .NET 2002/2003 to Visual Studio 2005
VSTS Backup and Restore Procedures
Team Foundation Server Permissions
Team Foundation Server Default Groups, Permissions, and Roles
TF.exe Command Line Reference
Books
Working with Microsoft Visual Studio 2005 Team System
Test-Driven Development in Microsoft .NET
Test Driven Development: By Example
Refactoring: Improving the Design of Existing Code
Refactoring to Patterns
Bloggers
Rob Caron
Rick LaPlante
Eric Jarvi
Buck Hodges
Jeff Beehler
Eric Lee
Nagaraju Palla
Khushboo
Gautam
Visual Studio Team System User Education
WebCasts
Introduction to Visual Studio Team System
How and Why Process Guidance Matters in Visual Studio 2005 Team System
Visual Studio 2005 Team System: Enterprise-Class Version Control
Managing Work with Visual Studio 2005 Team System
Test-Driven Development Using Visual Studio Team System
Accessing Visual Studio 2005 Team System Using the Teamprise Plug-In for Eclipse (Level 200)
Best of Launch: Visual Studio 2005 Team System (Level 200)
Load and Web Testing with Microsoft Visual Studio 2005 Team System (Level 200)
Migrating to Microsoft Visual Studio 2005 Team System (Level 200)
Shipping on Time and Under Budget with Visual Studio Team System (Level 200)
3rd Party Products
Teamprise
TeamLook
TeamPlain
VSTSEclipse 
VSTSPlugins
Tips and Tricks
  • When checking an item into source control you have the ability to associate a WI with that change set.  If you choose to do so there are two options, Resolve and Associate.  If you select Resolved the WI state will advance to the next state.
  • Fully process the TFS warehouse
  • Team Explorer blank ( missing server or lost network connection )
    • Delete the cache folder @
      • C:\Documents and Settings\<user>\Application Data\Microsoft\VisualStudio\8.0\Portfolio Explorer
      • C:\Documents and Settings\<user>\Local Settings\Application Data\Microsoft\Team Foundation\1.0
  • Tools to modify WIT
    • WitExport.exe, WitImport.exe, WitFields.exe
    • These are found @ c:\ProgramFiles\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\
  • Change the TFS warehouse run interval
  • Secure a WIT transistion
    • <TRANSITION from="State 1" to="State 2"
         for="[global]\StateChangers"
         not="[global]\GroupThatsRestrictedStateChanges" >

  • Drivers required to create adhoc Excel reports against the TFS Analysis Services.  Install Microsoft Core XML Services (MSXML) 6.0 and Microsoft SQL Server 2005 Analysis Services 9.0 OLE DB Provider from the SQL Server 2005 Feature Pack

MSBuild & Team Build

Jomo Fisher on MSBuild

Robert McLaws MSBuild Compatibility Toolkit 1.0

Nagaraju Palla's Building binaries targeting .NET 1.1 and .NET 1.0 in TeamBuild

Khushboo's CI using Team Foundation Build 

 
.NET SDC Solution Build & Deployment Process & Tools
Downloads
Visual Studio 2005 Web Application Projects, ScottGu On Web Application Projects
Visual Studio 2005 Web Deployment Projects
SQL Server 2005 Feature Pack
Tools

FiddlerPopUp Forum Post

Test Driven .Net

BizUnit

.Net | MSBuild | TeamBuild | VSTS
Wednesday, February 08, 2006 11:32:17 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

TFS Release Candidate Upgrade and Install, Completed!#

All I can say is WOW WOW WOW!  I am very impressed and very stoked!  I have successfully completed one dual server install and upgraded a very active, multi-project single server installation.  Each took about 3 or 4 hours, where most of the time sucked up backing up and copying db files and ISO images around.  Huge improvement over the past installs.  This product just gets better with each release!  While the release candidate brings a number of improvements, a few of my favorite are:

  • Removing the BuiltIn/Administrators group from TFS groups the users contained in that group actually disappear in the drop down lists
  • Real user names in drop down boxes rather than aliases
  • An upgrade procedure.  B3 to RC was very straight forward and easy
  • Huge performance improvements
  • New reports
  • "Go To Changeset" ctrl + g in source control
  • Installation and health checking greatly improved
  • Installation instructions are greatly improved

If your one of those developers who reads blogs rather than instructions there are a few things to note:

  • Reporting services changes, dual server, uninstall/install or install
    • Reporting services was moved from the data tier to the application tier
    • Uninstall Reporting services on the data tier and delete its two supporting databases
    • When you install Reporting services on the application tier you cannot run the service as local system.
    • That user you've selected to run reporting services will need "Log On Locally" rights on the appropriate machines
  • The TFS upgrade utility can be found here: Upgrade Utility
  • There are two hotfixes which have to be installed on the appropriate machines, both are found on the media. KB913393, KB912838
  • Use the server name rather than the IP for the TFS data tier address
  • Run TfsBuildUpgrade.exe from a client machine and not the TFS server
  • For an upgrade, backup those databases
  • Just read those instructions!

Hats off to the product group, for a job well done!

Tuesday, February 07, 2006 11:19:43 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

The TFS Release Candidate Was Cut!#

Yesterday ( Friday ) the official TFS Release Candidate was cut.  Today I received my copy and tomorrow I upgrade.  I'm stoked!

The bits are on their way to the MSDN download center and you should see them sometime on the 7th.

Saturday, February 04, 2006 8:04:05 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

What's new in the TFS Release Candidate?#

Check out this post from Jeff Beehler for all the details.

Friday, January 27, 2006 10:25:15 AM (Central Standard Time, UTC-06:00) #    Comments [1]  | 

 

Testing Code Snippets#

Code Snippets just rock.  I thought I would post my testing code snippets.

CSTestSnippets.zip (2.2 KB)

VBTestSnippets.zip (2.13 KB)

Just add them to the appropriate place under "My Documents\Visual Studio 2005\Code Snippets\"

Monday, January 23, 2006 3:26:51 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Converting a csproj into a test csproj#

Short answer.

It's as simple as adding one line to your csproj which in turn tells the IDE to treat that project like a test project.  Add the following line to your main PropertyGroup:

<ProjectGuid>{04082EBA-C85C-4336-B3FD-9891096BAA0F}</ProjectGuid>

Then just reference Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll and you are on your way.  Be sure to verify that Guid between releases. 

Long Answer.

When I start a project I create the base set of known assemblies that project will need.  I also add an additional test project which will contain any Scenario, Load and Stored Procedure tests.  Then I convert all assemblies to test projects.  I am a firm believer in Test Driven Development.  IMHO it is the only way to properly write code.  Having said that over the years I have developed my own set of TDD practices; one of which is the physical placement of your unit test classes in the assembly their testing.  Why? Well I will explain that in a future post call Unit Testing with Partial Classes.

With any decision there are of course trade-offs. In this case the trade-off is around the IDE interaction with hosting type projects, ie exe or web.  After you convert an exe to a test project, when you decide to run ( F5 ) it will actually fire off Test Manager rather than the launch app.  If you are a TDD bigot like me this is actually the correct action; if your not, I know your already complaining.  BUT all is not lost!  There is a little tool us TDD bigots keep in our back pocket at all times, TestDriven.Net.  This is an Visual Studio add-in and it allows you to execute your unit tests with just a right click.  If you choose to use this tool it isn't necessary to convert your project to a test project but rather just reference the Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll.  This will allow you to fire your app as intended and run your tests with the same project configuration.

Disclaimer: this is not a Microsoft recommend practice.  You can find more information about the Visual Studio Team System Testing Framework here.

Saturday, January 21, 2006 8:36:27 AM (Central Standard Time, UTC-06:00) #    Comments [2]  | 

 

VSTS User Education Team Blog#

Rob Caron has relaunched the VSTS User Education Team Blog.  If you are working with TFS then you need this on your blogroll.  Be sure to check out the following three posts:

VSTS Backup and Restore Procedures
Team Foundation Server Permissions
Team Foundation Server Default Groups, Permissions, and Roles
Saturday, January 21, 2006 7:01:48 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Unit Testing with Anonymous Methods#

Mark Seemann recently published a great post demonstrating the use of anonymous methods in unit testing events.  Testing Events Using Anonymous Methods

That just rocks, thanks Mark!

Friday, January 20, 2006 7:14:39 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

VS 2002 / 2003 / 2005 Conversions and Building#
Friday, January 20, 2006 6:37:36 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

TFS Release Candidate is Coming#

Start getting ready, TFS RC is on it's way.  Thank you Jeff for the heads up!

Thursday, January 19, 2006 8:28:07 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

ExpectedException Exception Message Validation#

While you cannot validate you exception's message in the ExpectedException attribute all is not lost.  Lets walk through three scenarios.

In all three tests you will see an Assert.Fail in the try block.  You need this statement in case the target doesn't throw any exceptions, therefor failing the test.  The first example is a passing test, throw and exception with a message, catch it and compare the message string. 

   [TestMethod]
   public void PassingException()
   {
      const string expectedExceptionMessage = "Foobar Message";

      try
      {
         throw new ApplicationException( expectedExceptionMessage );
         Assert.Fail( "Expected an exception to get thrown by target" );
      }

      catch ( ApplicationException ex )
      {
         Assert.AreEqual<string>( expectedExceptionMessage, ex.Message );
      }
   }  

Here we see the same test failing only because the message contained in the exception is different.

   [TestMethod]
   public void FailingOnExceptionMessage()
   {
      const string expectedExceptionMessage = "Foobar Message";

      try
      {
         throw new ApplicationException( "Invalid" );
         Assert.Fail( "Expected an exception to get thrown by target" );
      }

      catch ( ApplicationException ex )
      {
         Assert.AreEqual<string>( expectedExceptionMessage, ex.Message );
      }
   }

While this last test follows the same pattern seen above the test is really only testing for the type of exception being throw.  This should be refactored to use the ExpectedException attribute.

   [TestMethod]
   public void FailingOnExceptionType()
   {
      const string expectedExceptionMessage = "Foobar Message";

      try
      {
         throw new Exception( expectedExceptionMessage );
         Assert.Fail( "Expected an exception to get thrown by target" );
      }

      catch ( ApplicationException ex )
      {     
      }

      catch
      {
         Assert.Fail( "Incorrect Exception type was thrown by target" );
      }
   }

Same test refactored, this test still fails but only to illustrate that example.

   [TestMethod, ExpectedException ( typeof ( ApplicationException) )]
   public void FailingOnExceptionType()
   {
      throw new Exception( "..." );
   }

Monday, January 16, 2006 9:27:52 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

ExpectedException might not be what you've expected#

If you've switched from NUnit to the VSTS Unit Testing then I am pretty sure you've used the ExpectedException attribute. If you haven't it looks something like this:

[ExpectedException( typeof( ApplicationException ), "Message" )]

Using it with a test would look like the following:

[TestMethod, ExpectedException( typeof ( ApplicationException ) ) ]
public void ut1()
{
   throw new ApplicationException();
}

[TestMethod, ExpectedException( typeof( ApplicationException ), "foo" )]
public void ut2()
{
   throw new ApplicationException("bar");
}

You would naturally expect test ut1 to pass and ut2 to fail.  ut2 should fail on the bases that the message contained within the exception was in fact different.  Not true.  Both actually pass and not because of a bug but rather a new feature introduced to the attribute.  The Message property is actually a message that prints out with the test when it fails; just like the optional message property you find on all of the Assert methods.

   Assert.IsTrue( false == true, "Developer put explanation if this test was to fail" );

That message will print with the output of the test like so:

Error 1 TestCase 'ExpectedExceptionTest.ExpectedException.ut3' failed: Assert.IsTrue failed. Developer put explanation if this test was to fail
at ExpectedExceptionTest.ExpectedException.ut3() in C:\MyPrograms\ExpectedException\ExpectedExceptionTest\ExpectedException.cs:line 26 C:\MyPrograms\ExpectedException\ExpectedExceptionTest\ExpectedException.cs 26 

Lets correct ut2:

[TestMethod, ExpectedException( typeof( ApplicationException ), "I failed because I am looking for the wrong excpeption type" )]
public void newUt2()
{
   throw new Exception( "foobar" );
}

This will in fact fail because the Exception type thrown was different.  When it fails we will see that message in the output.

Having said all that, there is in fact a bug.  When you run a test with that ExpectedException attribute in Visual Studio you will not see the message on the failure output; if you run it in MSTest.exe you will.

ExpectedException.cs (.75 KB)

Friday, January 13, 2006 11:34:54 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

All content © 2010, Clark Sell
On this page
This site
Calendar
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: