How I learned WF 4.0 for Team Build

by Donovan Brown 11. September 2010 21:17

Problem:

I have to customize a TFS2010 Build and I don't know Windows Workflow 4.0.

Solution:

I watched the following video to quickly bring me up to speed on Windows Workflow 4.0 and then I read the workflow of the default build template.

http://msmvps.com/blogs/theproblemsolver/archive/2009/12/08/online-wf4-presentation-recordings.aspx

Tags: , ,

Work

How to deploy a Database Project with Team Build 2010

by Donovan Brown 6. September 2010 19:17

Problem:

I need to deploy a database project during a Team Build.

Solution:

Edit the dbproj file to include the Deploy target.

Explanation:

  1. Open the solution that contains the desired database project. 
  2. Right click on the database project and select properties. 
  3. Click the Deploy tab and verify the Deploy Action is set to "Create a deployment script (.sql) and deploy to the database, and the Target Database Settings are correct. 
  4. Now we need to update the .dbproj file to include the Deploy target.  From the Solution Explorer right click the database project and select "Unload Project". 
  5. Right click on the database project and select "Edit [database].dbproj" where [database] equals the name of your database project. This will open the .dbproj with an XML editor. 
  6. Update the DefaultTargets attribute of the Project element to "Build;Deploy". 
  7. Save and close the file then right click the database project and select "Reload Project". 
  8. Check in your database project.
  9. Queue your build. Your database will be built and deployed.

Tags: , ,

Work

Verify SharePoint 2010 Products for Team Foundation Server

by Donovan Brown 24. August 2010 22:19

Problem:

You have to install TFS2010 on an existing Sharepoint2010 install.  How do I verify it is configured correctly?

Solution:

I have been handed many preinstalled SharePoint 2010 machines to use with TFS installs or upgrades. The problem is there are many options that must be just right for it to work with TFS and confirming those settings can be very difficult if you don’t use SharePoint very often.  For example the two I constantly have to verify are that the web application on port 80 has NTLM set for IIS Authentication and the Anonymous Access is disabled. 
Here are the steps to confirm this information. 
1. Open Central Administration
2. Click Manage web applications under the Application Management section
3. Select the desired Web Application
4. Click the Authentication Providers button
5. On the Authentication Providers Pop Up click the Default link
6. You can now edit the authentication settings and confirm that NTLM is selected and Anonymous Access is disabled.

Tags: , ,

Work

How to upgrade from beta 1 to v1 of Microsoft Visual Studio Scrum

by Donovan Brown 28. July 2010 19:03

Problem:

We installed beta 1 of Microsoft Visual Studio Scrum and we need to upgrade without creating a new Team Project.

Solution:

1. (Optional) Add "Build Failure" as Reason for bug to allow it to work with the out of the box build templates.

2. Download all work items to Excel

3. Copy values from Owned By to Assigned To and publish changes back to TFS

4. Update Work Item Types using witAdmin and overwrite the original Scrum beta work item types

5. Update the Microsoft Project Mapping file if you changed the default “Assigned To” mapping to “Owned By” for MS Project resources

6. Update Work Item Queries to show Assigned To instead of Owned By

7. Import new MS Scrum v1.0 reports and bind to data sources

8. Import new build templates 

Explanation:

If you want to use an existing Build Template you may need to add the Build Failure reason to the bug work item type.  I would suggest making this change before you upload the template to TFS or use witAdmin to update the existing projects.   If you are going to update the original Build Template with the one in v1 you will lose the ability to create bugs on build failure.  The new template does not even allow it. I don't want failed builds to go unnoticed so I modify my build to fit the best practice established in the original release of TFS.  If you want to use that you should add the following reason tot the bug.

<REASON value="Build Failure" />

 

To begin download the latest version of Microsoft Visual Studio Scrum and install it. This process only copies the files to your computer it DOES NOT install into TFS.  You must use the Process Template Manager to upload the Template. The default location of the install is C:\Program Files (x86)\Microsoft\Microsoft Visual Studio Scrum 1.0\.

 

To upgrade an existing project we need to first move the Owned By values into Assigned To.  We need a All Work Items query to import the work items into Excel.  So create a simply query that returns all work items and save it.  Open Excel and import all work items using this query.  I found it helpful to sort the data by Owned By so I don't concern myself with those not currently Owned By anyone i.e. Sprints, Test Cases and Shared Steps they did not use Owned By. Make sure both columns Owned By and Assigned To are showing and copy from Owned By to Assigned To and publish.

Now simply use witAdmin or the Process Template editor to import the new work item types. The only two work items that DID NOT change are Shared Step and Test Case. The rest of the work items all have changes and should be imported.  However, if you receive an error trying to import the bug issue the following command:

c:\>witadmin changefield /collection:http://servername:8080/tfs/Collection0 /n:Microsoft.VSTS.TCM.ReproSteps /name:"Repro Steps"

Note if you made any customizations to the work items those will need to be remade on before you import.

Many of the Work Item Queries need to be updated to show the Assigned To field instead of the old Owned By field.  To update simply Right Click on the Query and select Edit Query.  Now click the Column Options button and remove the Owned By field and replace it with Assigned To. Repeat this for all the existing queries.

There was a new query added under the Current Sprint folder called Test Cases. It is a very simple query that simply list the work items of type Test Case.

Now use tfsfieldmapping to upload the Microsoft Project mappings.  The file you need to upload is located C:\Program Files (x86)\Microsoft\Microsoft Visual Studio Scrum 1.0\ Process Template\Classification\FileMapping.Xml.  Note you must be on a machine that has Office Primary Interop Assemblies (PIA) installed.  If you have Microsoft Project on the machine you should be fine. If not you can download the installer here http://www.microsoft.com/downloads/details.aspx?FamilyID=59daebaa-bed4-4282-a28c-b864d8bfa513&DisplayLang=en.

There are four new reports and two of the old ones were updated.  The process is the same for new or updated reports simply remember to check the box to overwrite existing reports.  All the reports are located in C:\Program Files (x86)\Microsoft\Microsoft Visual Studio Scrum 1.0\ Process Template\Reports.  The four new reports are Build Success over Time, Build Summary, Test Case Readiness and Test Plan Progress.  The new reports are in two sub folders Builds and Tests. The two reports that changed are Release Burndown and Velocity.  Simply visit the report server site and upload the new reports.  Once the new reports are uploaded you will have to update the data sources and the ExplicitProject Parameter.  To update the data sources click the Properties tab of the report and select the Data Sources link.  If the report was using TfsReportsDS map that to Tfs2010ReportsDS. If the report was using TfsOlapReportsDS map that to Tfs2010OlapReportDS and click the Apply button. While still on the Properties Tab click the Parameters link.  On the parameters page remove the value for ExplicitProject and uncheck the Prompt  User button and click Apply. Now you can view the report.

Final step is to check out the current DefaultTemplate.xaml file and check in the copy from v1.  Remember the new copy removes the creation of a bug on build failure.

Tags: , ,

Work

TFS, Reporting Server and SharePoint security from command line

by Donovan Brown 27. May 2010 19:39

Problem:

I have to perform a migration many teams over to TFS and assign permissions to TFS, Report Server and SharePoint for dozens of Team Projects.

Solution:

Use a batch file to set the permissions to all three locations at once.

Code:

TFS

TFSSecurity /g+ %1\Readers "[domain]\[user or group]" /collection:[tfs]\DefaultCollection

Report Server

rs -i security.rss -s http://localhost/reportserver -v userName="[domain]\[user or group]" -v roleName="Browser" -v itemPath="/TfsReports/DefaultCollection/%1" -v keepCurrentPolicy="True"

Sharepoint

stsadm -o adduser -url http://[tfs]/sites/DefaultCollection/%1/ -userlogin "[domain]\[user or group]" -role Contribute -username "Development Team" -useremail "developmentteam@[domain].com"

·         %1 is a parameter to a batch file. The value passed into the batch file is the Team Project you want administer security over.

·         All username or groups are in the domain\username format so replace [domain] with your domain and [user or group] with the username or group you wish to assign permissions too.

·         [tfs] is the name of your TFS AT Server

Explanation:

Be sure that rs.exe, stsadm.exe and TFSSecurity.exe are on the machine you execute these commands from and are in the path.  You must run the command prompt as Administer for the stsadm commands to succeed.  

security.rss (2.47 kb)

Tags: , , , , ,

Work

Scrum for TFS is released

by Donovan Brown 17. May 2010 17:24

Tags: ,

Work

VS2008 connecting to TFS2010

by Donovan Brown 24. March 2010 21:05

Problem:

I can’t connect to TFS2010 with VS2008 SP1

Solution:

You need to download Forward Compatibility Update for Team Foundation Server 2010

Explanation:

While at a client site we discovered that SP1 was not longer enough to connect to TFS2010 RC.

Tags: ,

Work

Installing VSTS 2010 Beta 2 Test Controller in Workgroup

by Donovan Brown 24. November 2009 01:57

Problem:

I need to install VSTS 2010 Test Controller on my Dev machine in a Workgroup but my configuration fails.

Solution:

Be sure an install the Test Controller on your TFS server first and make sure the account you plan to use is in the groups mentioned here:

http://msdn.microsoft.com/en-us/library/dd648127(VS.100).aspx

Code:

N/A

Explanation:

After setting up TFS 2010 Beta2 I wanted to run the Test Controller on my physical Dev machine.  I am running workgroup edition and kept getting the following error when I tried to configure the Test Controller on my machine:

Failed to grant permission to controller service account on Tfs http://MyTfs:8080/tfs/DefaultCollection. Microsoft.VisualStudio.TestTools.ConfigCore.ConfigToolException: User account i7307\Donovan L Brown not found

Failed to update TFS Team Project Collection http://MyTfs:8080/tfs/DefaultCollection as the test controller service account could not be granted required permission. To fix this error, run this tool with an account that has "Project Collection Administrator" rights and try again.

Well the account I was using had the "Project Collection Administrator" rights.   I searched MSDN and found the following article that got me close but not the entire way. http://msdn.microsoft.com/en-us/library/dd648127(VS.100).aspx What that article did for me was have me start checking for the existence of the two groups mentioned in step 3 under Requirements for Workgroups.  When I return to my TFS server to check they were missing because I did not install the Test Controller there.  Once I installed the controller on my TFS server and made sure the user account I planned to use as in all the correct groups I was able to complete the configuration on my Dev machine.

Tags: ,

Work

Create Custom Work Item control to list all the names in Assigned To dropdown.

by Donovan Brown 7. November 2009 15:22

Problem:

I need to create a custom control that shows the same list of users as the Assigned To drop down.

Solution:

Use the AllowedValues collection of the System.AssignedTo Field of the work item.

Code:

foreach(string user in ((WorkItem)WorkItemDataSource).Fields["System.AssignedTo"].AllowedValues)
   _myDropDownList.Items.Add(user);

Explanation:

I have read many post on how to get the list of users and many take a much more difficult path using IGroupSecurityService.  The AssignedTo field has already done all the hard work so why do it again?  Simply cast the WorkItemDataSource property of the IWorkItemControl interface implemented by your custom work item control to a WorkItem and use the AllowedValues collection of the AssignedTo field.

Tags: ,

Work

Where to store connection strings for Custom Work Item Controls

by Administrator 7. November 2009 15:08

Problem:

I need to store a connection string for a custom work item control.

Solution:

Store the connection string in a Team Foundation Server Global list.

Code:

The global list that needs to be imported into your Team Foundation Server

<GLOBALLISTS>
   <GLOBALLIST name="ConnectionStrings">
      <LISTITEM value="http://host/Vdir/WebService.svc" />
   </GLOBALLIST>
</GLOBALLISTS>

The field to add to your Work Item Type definition.

<FIELD type="String" name="ConnectionString" refname="DLB.ConnectionString">
   <ALLOWEDVALUES>
      <GLOBALLIST name="ConnectionStrings" />
   </ALLOWEDVALUES>
</FIELD>

Code for accessing the connection string in your Custom Work Item Control.

protected string ConnectionString
{
   get { return ((WorkItem)WorkItemDataSource).Fields["DLB.ConnectionString"].AllowedValues[0]; }
}

Explanation:

On a recent project I had to develop several Custom Work Item controls for Team Foundation Server. A couple of the controls made calls to a web service to retrieve the data to display.  The problem I needed to solve was where is the best place to store the connection string for the web service so it can be updated easily and simple to access from the Custom Control.  The idea I came up with is to store the  connection string in a Team Foundation Server global list.

Global list can be administered using the glexport and glimport commands and also by power toys and third party tools.  By adding an additional field to the work item definition I can easily access the connection string from the WorkItemDataSource property of the IWorkItemControl interface implemented by my custom work item control.

There are three sections to this solution.  First the entry into the global list to store the connections strings.  The second is the field I added to the work item definition to ease accessing the values of the global list.  I am sure you can gain access to the global list in other ways but using the AllowedValues collection is very simple. The final step is casting the WorkItemDataSource to a WorkItem, and accessing the correct index of the AllowedValues collection of the field we added to the Work Item Type definition.

Tags: , ,

Work

About the author

My name is Donovan Brown and I am a Technology Specialist for DevTools with Microsoft with a background in application development.  I also run one of the Nation’s fastest growing online registration sites for motorsports events DLBRacing.com.  When I am not writing software I race cars for fun.  DLBRacing.com has given me the opportunity to combine my two passions writing software and racing cars.

AdSense

Month List

AdSense