Wednesday, November 28, 2012

Enabling Versioning on TFS SharePoint Portal (WSS)

By default the WSS (Windows SharePoint Services) has No versioning for the Shared Documents. We could change if you need versioning for documents

Here are the steps

1. Open the Shared Documents -> Settings page

clip_image002

2. Settings page appears, choose “Versioning Settings”

image

3. Change version settings as per your requirements

clip_image006

Thursday, July 5, 2012

How to deploy TFS Server Plug-ins

As per the development team’s requirement we might end up creating TFS Server plug-ins to automate various processes. Since the TFS server plug-ins would intercept each and every (subscribed) events, we need to keep the TFS Server plug-in process very quick, so we always extend the TFS Job to perform the actual work on the background.

I have outlined the step for how to deploy those plug-ins and job extensions on the TFS servers.

TFS Server Plug-in

Caution: TFS services will be restarted whenever the plug-in assemblies are copied on TFS app server.

Copy the TFS plug-in assemblies to <System Drive>:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Services\bin\Plugins folder on each TFS app servers

TFS Job Extension

Fresh install

Copy the TFS Job extension assemblies to D:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\TFSJobAgent\plugins folder on each TFS app servers

Update

1. Stop “Visual Studio Team Foundation Background Job Agent” on the TFS App Server.

  1. Copy the TFS Job extension assemblies to <System Drive>:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\TFSJobAgent\plugins folder on the TFS app server

3. Start “Visual Studio Team Foundation Background Job Agent” on the App server

Friday, May 11, 2012

Eclipse and TEE - TFS access denied troubleshooting tips

We use TEE plug-in as part of Eclipse to access TFS. Here are the possible errors and reasons for intermittent access denied issues on Eclipse

User errors/issues:

Issue 1: “I have been having issues with Eclipse/TFS over the last few days.  The connection is intermittent.  I’ve been getting the following errors:

Could not execute check in pending changes

Authorization failure connecting to: [http://tfsserver:8080/tfs/Default_Collection/WorkItemTracking/v3.0/ClientService.asmx] (authenticating using credentials (Default Credentials))”

Issue 2: “com.microsoft.tfs.core.clients.versioncontrol.exceptions.VersionControlException: Server returned HTTP status 401 for POST http://tfsserver:8080/tfs/Default_Collection/VersionControl/v1.0/upload.ashx

Issue 3: Access denied at checkin

image

Issue 4: Error importing TFS project

“I’m having trouble importing the TFS xxxx project into my Eclipse workspace. Is there someone that could help with it?”

Issue 5: Error connecting to TFS

“I’m getting this error message when trying to connect to the TFS in Eclipse, shown in the screenshot below. Could you help me with it?”

image

Issue 6: Error connecting to TFS

“I’ve been out for 6 weeks and am trying to update my workspace.  I’m getting Access Denied TFS errors in Eclipse.  It seemed like my workspace was connected and refreshing but I kept getting the access errors. I didn’t get disconnected and it didn’t ask for a password but the errors kept popping up.  I deleted everything and started again following the instructions for connecting to the TFS server using Team Explorer everywhere.  Now I’m not connected and can’t connect.   I was able to access the web version of TFS without a problem.

Can someone check my access?”

Reasons and Resolutions

1. New User

If the user is new to this TFS instance then the user needs to be added to appropriate TFS groups for TFS Access.

Resolution:

Contact your TFS admin for Access.

2. Account Locked out

Sometime your account might be locked out for various reason. So if your account is locked out, the TFS authentication will fail.

Resolution:

Check with your network admin to unlock your account.

*********IMPORTANT: Please follow the steps when making changes to the TEE configuration files

  • Close Eclipse
  • Locate the file as specified
  • Make backup of the files
  • Make changes
  • Open Eclipse
3. Changed Password/Stored password

TEE has option to store the username and password, so when you change your network password, TEE tries to use old password and it fails to connect

Resolution:

It is recommended that you always to use DefaultCredentials that way it is seamless when you change your network password.

This setting is available at profiles.xml and sometime it would be in workspaces.xml as well.

Update the useDefaultCredentials property as true on the profiles.xml. Example

<property name="useDefaultCredentials" type="boolean">true</property>

The profiles.xml file can be found at

XP

C:\Documents and Settings\<Your ID>\Local Settings\Application Data\Microsoft\Team Explorer\10.0\profiles

Windows 7

C:\Users\<Your ID>\Local Settings\Application Data\Microsoft\Team Explorer\10.0\profiles

4. Clearing TEE/TFS local cache

Sometime the TFS local cache might have old values, you might need clean them.

Resolution:

  • Close Eclipse
  • Location the db folder and delete just ONLY folders under this directory
  • XP
  • C:\Documents and Settings\<Your ID>\Local Settings\Application Data\Microsoft\Team Explorer\10.0\db
  • Windows 7
  • C:\Users\<Your ID>\Local Settings\Application Data\Microsoft\Team Explorer\10.0\db
  • Open Eclipse

5. Workspace has invalid mapping (Old/wrong TFS server name)

Some situation one or more workspaces would have old/wrong tfs server url. You might to need to correct them.

Resolution:

Verify the Workspaces.xml for invalid serverUrl.

The correct serverurl should be as following

  <property name="serverUrl" type="string">http://tfsserver:8080/tfs/Default_Collection</property>

The workspaces.xml file can be found at

XP

C:\Documents and Settings\<Your ID>\Local Settings\Application Data\Microsoft\Team Explorer\10.0\ workspaces

Windows 7

C:\Users\<Your ID>\Local Settings\Application Data\Microsoft\Team Explorer\10.0\ workspaces

Tuesday, April 24, 2012

TFS 2010 – Work Item Link Types

What and Why we need work Item Link Types

By creating relationships between work items and other resources, you can plan projects more effectively, track dependencies more accurately, view hierarchical relationships more clearly, and find relevant information more quickly. For example, you can create a relationship between two work items to show that one of the items must be completed first. In addition, you can create a relationship between a work item and a changeset to show how the code was changed to address a feature request.

When you create relationships between work items, you select the type of link that best supports your project planning and tracking efforts. Different types of links support different capabilities and are based on one of four topologies as described below.

  • Use a Related Link to Make Non-Hierarchical Relationships
  • Use Parent-Child Links to View Multi-Tiered, Hierarchical Relationships
  • Use Predecessor-Successor Links to Plan and Track Project Tasks and their Dependencies
  • Use Dependent Links to View and Track Dependent Work Items
  • Use Changeset and Versioned Item Links to Associate Tasks and Features with Development Work and Version Items

Topologies

Network: You can use network links to create basic relationships between work items that are non-restrictive. The link is the same at both end points. Circular relationships are allowed.

Example usage: Use a network link, such as Related, to record a relationship between two features that might share dependencies.

Topology of Network Links

Directed Network: You can use directed network links to create relationships between work items that indicate directionality. The link name is different at the end points. Circular relationships are allowed.

Example usage: Use a directed network link to record a relationship between two features that might share dependencies and which you want to distinguish from each other in some way.

Topology of Directed Network Links

Dependency: You can use dependency links to create relationships between work items that have directionality and to restrict circular relationships. The link name is different at the end points.

In the illustration, you cannot create a dependent link to a work item that contains dependent link relationships to the same work items.

Example usage: Use a dependency link to record the features that must be completed to deliver a user requirement.

Topology of Dependency Links

Tree: You can use tree links to create multi-level hierarchical relationships among work items. Tree links support multi-level hierarchical views, have directionality, and restrict circular relationships. The link name is different at the end points. Tree links are the only type of link that is supported by the Tree of Work Items query.

In the illustration, you cannot assign two parents to a child.

Example usage: Use a tree link to record tasks and subtasks from your team that must be completed to deliver a feature.

Topology of Tree Links

Here is the Parent-Child links and Dependency links detail, detail about other links are available at http://msdn.microsoft.com/en-us/library/dd286513.aspx

Parent-Child Links

You create parent-child links between work items in order to view multi-tiered, hierarchical relationships between the work items. This link type is most often used to break down user stories into features and to divide tasks into subtasks. Parent-child links are based on the tree topology, support a one-to-many relationship set, and prohibit circular definitions, that is, a child node can only have one parent.

Benefits:

Restrictions and recommendations:

  • A work item can have only one parent, although a parent work item can have many children.

  • Work items joined by parent-child links must be defined for the same team project. This action is recommended if you plan to use Office Excel or Office Project to modify or update work item data.

    Note Note

    You can create parent-child links between work items that are defined in different projects. However, if you export a query to Office Excel or Office Project, only those work items that are defined for the team project for which the query is defined are imported into the Office client.

Dependent Links

You create links to work items by using a dependent link type in order to track work items that impact the ability to complete a requirement, feature, or task. Also, you can create links to work items that cross project boundaries.

Dependent links are based on a dependency topology, support one-to-many relationships, and prohibit circular definitions. You can perform any of the following tasks by using dependent links:

Benefits:

  • Find and view top-level work items and their dependent work items in a two-tiered view. For more information, see View and Modify Work Items in a Direct Links View.

  • Manage risks and dependencies and collaborate more effectively across project teams. For example, you can reach the following goals by defining dependent links between work items in your team project and those defined in another team project:

    • Create a dependent relationship to a feature or set of tasks that are under development by another team.

    • Request that another team accept a work item dependency.

    • Manage your commitments and cross-group dependencies to other teams.

Restrictions and recommendations:

  • Use dependent links when work items share dependencies. For example, use them when a user story has many features and some of the features fulfill two or more user stories.

  • Use dependent links rather than other link types to associate work items that are defined in another team project.

  • You cannot view hierarchical relationships created with dependent link types using Office Excel or Office Project except for those instances noted earlier in this topic for parent-child links and predecessor-successor links. 

Available Link Types in TFS 2010

Here are the available link types in TFS 2010.

System Defined Link Types

Forward Name

Reverse Name

Link type reference name

Topology

Successor

Predecessor

System.LinkTypes.Dependency

Dependency

Child

Parent

System.LinkTypes.Hierarchy

Tree

Related

Related

System.LinkTypes.Related

Network

MSF Process Template – Link Types

Forward Name

Reverse Name

Link type reference name

Topology

Tested By

Tests

Microsoft.VSTS.Common.TestedBy

Dependency

Test Case

Shared Steps

Microsoft.VSTS.TestCase.SharedStepReferencedBy

Dependency

Links and Resources

Add a Link Type: http://msdn.microsoft.com/en-us/library/dd469516.aspx

Defining Link Controls to Restrict Link Relationships: http://msdn.microsoft.com/en-us/library/dd638522(VS.100).aspx

Thursday, April 12, 2012

TFS Portal Error: This site doesn't have a default Team Foundation Server instance

Basically this error happens when SharePoint is NOT linked/connected with TFS. You can reconfigure this for the Team project where the portal is supposed to be connected.

Here are the steps.

First verify the TFS Collection has default SharePoint site.

Step 1: On Team Foundation Server Administration Console, Select the TFS Collection and “SharePoint Site” tab.

image

Step 2: Click “Edit Default Site Location” link and update the default site location.

image

Step 3: Access the SharePoint, if that did not fix the issue, reconfigure the portal setting for the team projects using Visual Studio

Reconfigure Team Portal Settings

Step 4: On the Visual Studio Team Explorer, right click on the Team Project and select “Portal Settings”

image

Step 5: Project Portal Settings page appears. Click on “Enable Team Project Portal” and Click on “Configure Url” button.

image

Step 6: On “Specify an existing SharePoint Site” window (as mentioned in image above), specify the SharePoint URL. Confirm the url by clicking on the URL link. Now the SharePoint would show the data from reports and other details

Step 7: Press OK to save the changes.

Start/Stop Visual Studio Team Build Service using API

Here is full code snippet to start/stop Visual Studio Team Build Service.

private const string TFSBuildService = "TFSBuildServiceHost";
private ServiceController TFSController;

public TeamBuildServiceController()
{
// Check if the Visual Studio Team Build service exists on the machine. If not then raise an error.
bool srvcExists = false;
foreach (ServiceController srvcOnMachine in ServiceController.GetServices())
{

if (string.Compare(srvcOnMachine.ServiceName, TFSBuildService, StringComparison.OrdinalIgnoreCase) == 0)
{
srvcExists = true;
break;
}
}


this.TFSController = new ServiceController {ServiceName = TFSBuildService};
}

public void StopService()
{
if(this.TFSController == null)
{
return;
}

// Stop the service if its running
if (this.TFSController.CanStop)
{
this.TFSController.Stop();
int timecounter = 0;

while (this.TFSController.Status != ServiceControllerStatus.Stopped)
{
if (timecounter > 60)
{
break;
}

timecounter++;
Thread.Sleep(1000);
this.TFSController.Refresh();
}
}

if(this.TFSController.Status != ServiceControllerStatus.Stopped)
{
Thread thread = new Thread(ShowMessageToRestart);
thread.SetApartmentState(ApartmentState.STA);
thread.Start(
"The Visual Studio Team Foundation Build service cannot be stopped. Changes to the environment variable will not reflect on the builds till the service has been restarted. \r\n\r\nPlease restart the service after the installation completes.");
thread.Join();
}
}

public void StartService()
{
if (this.TFSController == null)
{
return;
}

// Start TFS build service
this.TFSController.Start();
int timecounter = 0;

while (this.TFSController.Status != ServiceControllerStatus.Running)
{
if (timecounter > 60)
{
break;
}

timecounter++;
Thread.Sleep(1000);
this.TFSController.Refresh();
}

if (this.TFSController.Status != ServiceControllerStatus.Running)
{
Thread thread = new Thread(ShowMessageToRestart);
thread.SetApartmentState(ApartmentState.STA);
thread.Start(
"The Visual Studio Team Foundation Build service cannot be started. Team build will not be executed on this machine until the service is not started. Please try to start the service manually.");
thread.Join();
}
}




Wednesday, April 11, 2012

Creating TFS Alerts using Eclipse TEE

TFS Alerts are very useful to know about the work item updates,CI build statuses and check-in. There are some basic alerts available in TFS out of box and custom alerts in Power Tools. The alerts can be created using TFS Web Access and/or Visual Studio, but there were none using Eclipse.

Finally the Power Tools (Alert Editor) is available for Eclipse. Here are the steps to create alerts using Eclipse/TEE

Prerequisites

1. Eclipse 3.2-3.7

2. Microsoft Visual Studio Team Explorer Everywhere 2010 (TEE) with SP1

http://www.microsoft.com/download/en/details.aspx?id=25125

Step 1: Download and Install

The Team Foundation Server 2010 Powers Tools for Eclipse is available here. The setup instructions are available on the same page.

http://www.microsoft.com/download/en/details.aspx?id=28557

Step 2: Open Alerts Explorer on Eclipse

image

Step 3: The Alert Explorer would show all the alerts created by you. To create new alerts click on “New Alert”

image

image

Pick an alert template, example choose “Failed Builds” to send alert when a build fails.

Step 3: Update the Send to email address or pick the emailids by using the “Select Users” button.

image

Step 5: You can change the name of the Alerts, and add filters by adding fields and values.

image

Step 6:  You can save the alerts by clicking the save button. Now you have successfully setup a custom alert.

image