Team Foundation TFS 2010/2008 Deleting / Solving Multiple Workspace Problem

So you're setting up a new Workspace for Team Foundation and you get an error when you try and point a Source Control Project to a local folder that someone else was using as well..... Then you get the error message....

Error: "The working folder ... is already in use by another workspace on this computer"

I ran into this problem setting up a contractor's PC after the previous contractor using that PC had left.

The problem is you can't just go load up and delete workspaces unless your the owner. So in order to solve the problem I had to run a command line command for Team Foundation. Open Visual Studio 200x Command Prompt.

Tf workspace /delete developer05;<domain>\jsmith

 

To get that info I needed the owner name of the workspace and the workspace name. You can do

 

tf workspaces

  

You can find a list of Team Foundation (tf) commands here:

http://msdn2.microsoft.com/en-us/library/z51z7zy0(VS.80).aspx
You can see commands on that MS site, however the two most useful to me in this situation was listing the information, so I could see who was the other person blocking access, and then deleting it.

 

tf workspaces [/owner:ownername] [/computer:computername]
[/server:servername] [/format:(brief|detailed)]
 


tf workspace /delete [/server:servername] workspacename[;workspaceowner]

Note: Common mistake is to forget the domain name of the owner if you are on a domain. <domain>\UserName

 

Update:

So you’ve swtiched to a new machine or OS because your other system crashed and now you have these ghost items checked out in TFS and can’t check them in?

Easy.

First on TFS server, list the worksspaces for that old computer name (It tells you in Source Control Who and what PC has it checked out)

tf workspaces /server:http://…/Project/  /computer:mastro-pc

This will give you the list of workspaces:

 

Workspace                          Owner   Computer  Comment
---------------------------------- ------- --------- --------------------------
MASTRO-PC                          FMastro MASTRO-PC
SQL Source Control  (eb0jrdmq.4mh) FMastro MASTRO-PC Used by SQL Source Control
SQL Source Control  (ge1lsqh5.3gk) FMastro MASTRO-PC Used by SQL Source Control
SQL Source Control  (hewpvhe2.wai) FMastro MASTRO-PC Used by SQL Source Control
SQL Source Control  (vqdacg1f.bgr) FMastro MASTRO-PC Used by SQL Source Control
WIM 2010 (MASTRO-PC)               FMastro MASTRO-PC

 

Now go in and delete each one.

tf workspace /delete /sever:http://…/Project/ “MASTRO-PC”
tf workspace /delete /sever:http://…/Project/ “SQL Source Control  (eb0jrdmq.4mh)”
tf workspace /delete /sever:http://…/Project/ “WIM 2010 (MASTRO-PC)”
etc..

That will clear our those old changes you had on the no longer existent system.

VB.Net Strip Numeric Characters from an Alpha-Numeric String

I see it everywhere, people with blogs posting up ASP.NET/VB.NET code snippets.  At work I'm always asked to create a quick function how to do something. Or someone will say, "how do I do this?" and I can't help myself but write out the code real quick.  So I thought why not me? Why don't I start putting up my own code on my own blog?  So here I am.

So my first piece of code is super simple, just strips out numeric characters from an alpha-numeric string.  Now maybe there's already a built-in method in .Net that does this already, but .Net is so full of methods and namespaces and such that I don't know them all. 

So here we begin a new blog theme.

   1: ''' <summary>
   2: ''' Strips out Numeric characters from a Alpha-Numeric String
   3: ''' </summary>
   4: ''' <param name="HotStripper">Send Alpha-Numeric String</param>
   5: ''' <returns>String</returns>
   6: Function StringOutNumbers(ByVal HotStripper As String) As String
   7:      Dim NewValue As String = ""
   8:      For I As Integer = 0 To HotStripper.Length - 1
   9:           If IsNumeric(HotStripper.Substring(I, 1)) = False Then
  10:                NewValue += HotStripper.Substring(I, 1)
  11:           End If
  12:      Next
  13:      Return NewValue
  14: End Function

Example:

Dim myString As String = StringOutNumbers("Something1234")

 

 

Note: If you wanted only to pull out the numbers you could just change line 9, from False to True.

Am I a good programmer?

I came across an article just the other day where this guy Daniel writes about how to recognize a good programmer. In this article he lists some bullet points on how to tell....

 Positive indicators:

  • Passionate about technology
  • Programs as a hobby
  • Will talk your ear off on a technical subject if encouraged
  • Significant (and often numerous) personal side-projects over the years
  • Learns new technologies on his/her own
  • Opinionated about which technologies are better for various usages
  • Very uncomfortable about the idea of working with a technology he doesn’t believe to be “right”
  • Clearly smart, can have great conversations on a variety of topics
  • Started programming long before university/work
  • Has some hidden “icebergs”, large personal projects under the CV radar
  • Knowledge of a large variety of unrelated technologies (may not be on CV)

Negative indicators:

  • Programming is a day job
  • Don’t really want to “talk shop”, even when encouraged to
  • Learns new technologies in company-sponsored courses
  • Happy to work with whatever technology you’ve picked, “all technologies are good”
  • Doesn’t seem too smart
  • Started programming at university
  • All programming experience is on the CV
  • Focused mainly on one or two technology stacks (e.g. everything to do with developing a java application), with no experience outside of it

... so naturally I started to see which ones apply to me.  What in this list would define where I stand? As I started to look at the list it made sense and actually I could see it applied to someone one else I know who always wants to be a better programmer but lacks some of the bullets from the first part.

As I read the bullets, everyone one of the positive bullets matched with me, only one of the negatives I felt matched as well.  The last one about technology stacks.  At first I thought that contradicted learning new technologies from the first one but it doesn't.  Example, I learned AJAX, I'm learning Silverlight, those are new technologies. I am stacking the technology because I'm using everything with VB.NET.  That's what I feel I stack.  I can read C# but slower to code in it then VB and ususaly when I want to get something done I default to VB.NET because I already know it's full sytax.

Anyway, it was an interesting read.

My Birthday Weekend

Well it's my birthday weekend and I thought about going out to party, but then I came down with a cold and now I don't feel like doing anything.  Would be nice if I had some local friends that could plan a party for myself.  However, they are all up in New Jersey or down in Miami. 

 Happy Birthday to me!