DCSIMG
April 2008 - Posts - SRL Group

SRL Group

This blog is about Team System, QA and Development methodologies and more...

VSTS Resources

Team System Bloggers

April 2008 - Posts

Team Build: Recursive copy of BuildType folder? not in TFS 2008

Today I was trying to figure out why can't I load my dll placed deep down under buildType folder, during activation of build in TFS2008.

When I checked the folders created by this build on the builds server, I've noticed that the sources folder was copied recursively , as it should be.

But the buildtype folder was copied NOT recursively. subfolders appeared empty.

A great post by Neno Loje provided the answer:
http://msmvps.com/blogs/vstsblog/archive/2008/03/16/tfs-2008-team-build-doesn-t-get-subfolders-of-team-build-type-folder-by-default.aspx

This Post explains how to modify this build beaviour on the build server.

 

"Unable to cast object" Error in Custom Control

As the previous post about moving custom controls said, there are problems using the TFS2005 custom controls in TFS2008.

While writing custom control to TFS 2008 there are several things that can go wrong. The most puzzling (to my experience) is to compile with the wrong assembly version.

If you compile the custom control with the old assembly version (i.e. Microsoft.TeamFoundation.WorkItemTracking.Controls.dll version 8.0.50727.762 which belongs to TFS 2005) and you don’t copy the system dll to the target client folder you will get the following error:

TF210004: The control could not be loaded from the assembly

TF210004: The control could not be loaded from the assembly 

If you copy the dll’s (version 8) to the directory, you will get a more confusing message:

Unable to cast object of type `YourCustomControl` to type `Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl`.”

Unable to cast object of type `YourCustomControl` to type `Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl

The solution is to compile the control with the dll in version 9.0.* and not version 8.0.*

Solution not refreshed with new project

Hi

Here's a synchronization problem between solution explorer (VSTS 2008) and source control:

We have one solution file, containing all projects, and everybody's working with this solution.
If we add a new/existing project to the solution and check in, then other programmers, who are currently working with the solution, will not get this update even if they perform get latest version from the solution explorer !

It seems that "get latest version" operation on solution inside solution explorer does not refresh project list.

Workaround: Go to windows explorer / source control explorer and re-open solution file.

New empty folders problem in solution explorer

Hi,

Today I tried to solve a synchronization problem between VSTS 2008 and Team System, where cs projects contained folders and those folders do not exist in source control.

Furthermore, The programmer tried to delete those zombie folders from the solution explorer and got error message claiming those folders do not exist.
Well, They Don't, actually.

After handling this situation (by excluding zombie folder from project) I managed to recreate the problem:

In solution explorer, under any project, we add a new folder:

Adding new folder in solution explorer


The problem is that the only action pending is the update to the project file.
No folder creation is pending in source control explorer !


Folder not exist in source control explorer


Then we perform check in pending changes, No folder creation is pending.


check in


After that check in, everyone working with that project will have a reference to a non existing folder.
This problem appears only when we create new folder from the solution explorer, not from source control explorer.

The trigger for creating a new folder in source control is adding new items under that folder.

So we can use workarounds:

Workaround 1. Perform check in only after adding new items under that folder.
When we create new items under this new folder, this folder now exist in source control explorer.

Folder in solution explorer and source control explorer
Notice that even now, this new folder is NOT marked as in pending add but will be added after check in...

Check in - where is the folder?

Or -  Workaround 2: Go to Source control explorer and create the folder.

This workaround will be used if we insist to add a new empty folder to source control.

We add the new folder in the source control explorer:

Add folder in source control explorer

Now when we check in, we can notice this new empty folder in pending add state:

Check in creation of new empty folder

Move your project’s source code using the team source control “Move” command

 

In this post I like to introduce the source control "Move" option, explain how it works and what to expect when moving the source code from one location to another.

The "Move" command is used for moving source code from one location in the source control (Location A) to a target location in the source control (Location B).

In order to clarify how it works, I will use the following example:

I have created two locations I marked them as "LocationA" and "LocationB".

In "LocationA" I have created a project and I called it "TheSourceToMove".

In order to demonstrate what happens to the history of the project when I move the source code I have created some history entries to the project, the starting point of our example is shown in the screen shot:

History before moving source

Now I will right click the project and click on the "Move" command.

Note: In order to use the "Move" command I must use a workspace definition that is mapping both locations in the source control to my local computer.

Clicking the "Move" button

Next I will choose the new location:

Choose target location button

And finally click "OK".

The source code is now moved to the new location but...

Moving a source code to the new location is not moving all the history of the code to the new location. In order to demonstrate it I will continue the example but this time as a programmer that his workspace is mapped to the new location and I will try to get the version that is marked as "Second version of the code" in the history of the source code.

After moving the source to the new location

In the print screen we can see that the source code is now in the new location and the history is having a new entry: "Checking in to complete the move" this step is essential to finish the move of the source control, all that I have done there is check-in the project in the new location (LocationB in the example).

I will try to get the "Second version of the code" by right clicking the project and choosing the "Get Specific Version..."

Get specific version button

I will choose to get the "Second version of the code", after completing the check-out process I am checking my local folder and see that the local folder that is mapped to the project is empty!!! What happened???

The source control will only move the last version of the source code to the new location, in case I would like to get an older version from the source code history I will need to do it in the old location of the code (LocationA in the example), so before moving a source code from one location in the source control to another verify that the version that you like to work on is located at the top of the history list.

In order to complete the example and show another pitfall to avoid I will continue with the "Get Latest Version..." option.

The latest version is checked out to my local folder from the new location, it is important to remember that from the new location I will only be able to use this version and future versions I will check in from the new location.

So now we got left with one last question, what will happen if I will use the "Get Latest Version..." option to get the latest version, and then I will try to get and older version from the history? The answer is simple the latest version will be deleted from the local computer.

 

As we could see in the example moving a source code from one location to another is not a trivial task and has some pitfalls that need to be considered.

ALM405: Performance Driven Development - Slides & Demo

Wow, I cannot believe the Tech Ed is over. 

For me Tech Ed was a lot of work. Do not get me wrong I loved almost every minute of it.

My session was about Performance Driven Development. My goal in the session was to give an overview on the methodology called PDD and to deep dive into demos.

You can download the slides from here:

  1. Part 1.
  2. Part 2.
  3. Part 3.

You can download the code from here.

 

ALM 403: Control Database Lifecycle with Data Dude - Slides & Demo

Today I had the pleasure of presenting at TechEd Israel 2008. It was a great experience!

My Session went very well, if I do say so myself. I talked about controlling your database lifecycle with data dude.

In any case, if you were in my talk, I'd love to hear your comments (good or bad!) about it so that I can either feel good about it, or get better for next time.

Thanks to everyone that wake up for the talk - it was very well attended despite the time (9:00 AM after the midnight party...).

You can download here slides and demo:


 

Continuous Integration Service for TFS 2005 - supporting builds per sub folder

Hi

Unlike TFS 2008, Continuous Integration service is not included in TFS 2005, and a solution is provided by microsoft here:
http://msdn2.microsoft.com/en-us/library/ms364045(VS.80).aspx .

We download the binaries, create the CI virtual directory, fix the web.config file, and activate bissubscribe.exe.
Is that all? Well, not exactly.
This solution works well only if we use a single continuous Integration build for our team project.

But what if we wish to have many continuous Integration builds, one build for a separate sub folder in TFS?
Well, In this case, we have a problem.

But this problem has a solution:
Benjamin Day provides us an alternative CI that supports many builds:
http://blog.benday.com/archive/2007/11/19/23167.aspx . 

For those of us who already installed the previous solution by microsoft, the work is very easy:
Download his CI code, replace the old CI virtual directory with the Benjamin Day's CI,
and fix web.config. When you edit web.config , follow his instructions and edit AppSettings similar to
to the sample settings given in his blog:

<appSettings>
  <add key="LogFileName" value="CI-log.txt"/>
  <add key="TeamFoundationServer" value="http://labtfs:8080" />
  <add key="ServerUrl" value="http://labtfs" />
  <add key="1"
    value="TeamProjectName=Agile Team Project;BuildType=Default Build;
     PathToBuild=$/Agile Team Project/Main/Demo20071030" />
  <add key="2"
    value="TeamProjectName=Agile Team Project;BuildType=Branch Build;
     PathToBuild=$/Agile Team Project/Branches/Demo20071030" />
</appSettings>

It Works !