|
 Monday, March 03, 2008

Knock Knock. Who's There? Me. Too Bad. Go Away.

Yup, that's right. Team Foundation Sever told me TOO BAD, SO SAD, GO AWAY, TRY AGAIN ANOTHER DAY. What a great way to start a Monday. Oh, any by the way, we have an emergency release that might have to get pushed out. We're waiting on upper management to make the final decision... fun-fun it is.

YaleLock
Photo By: Auntie P

This weekend I rebuilt my machine. I have a Dell Inspiron 6400 Laptop and it came loaded with Vista Business (and TONS of junk-ware I don't need/nor care about). The one thing I love is that to restore back to factory settings only took about 10 minutes. Yes, 10 minutes - that's craziness. Most rebuilds take hours (unless you're using Ghost or something like that). There is a little partition on the drive that has the factory restore files on it. Just boot into the boot menu during start up (F8) and then choose restore to factory default and you'll have a factory machine within 10 minutes, total awesome-ness.

After I spend the next 6-8 hours installing VS2005, VS2008 (yes, I need both, some clients will only have VS2005 and the solution files in VS2005 and VS2008 are different, by a line), Office 2007, and my list of tools that are close to Hanselmans tools list I finally was ready to get back to work on Monday. I came in today and tried to connect to TFS (2005). Nope. Not going to happen. Here's the error:

 

TF31002: Unable to connect to this Team Foundation Server (...) Please contact your TFS Administrator.

 

Me: *Expletive*

Great, I am the TFS administrator. I have FULL access rights to TFS, I AM THE ADMINISTRATOR!! I have no idea why this would happen. I was able to connect last Friday, on Saturday before the re-install and team members are working against TFS as I speak. Then I rebooted, tried a few other things. Checked Windows firewall and a few other places. Nope. Still didn't work.

Me: *Expletive*

 

The Fix

I had a hunch this was caused by some type of interception of a call to TFS. I then decided to uninstall Macfee Anti-Virus because, well, because I can't stand anti-virus software that bloats my system. After the always-required-reboot, I started up VS2005 and tried to connect to TFS.

It worked.

I wanted to know if anyone else had this problem so I did a little poking around and I found this thread on the MSDN forums. It looks like this is the EXACT problem that I had.

Oh what a joy AV software is. Actually, I can't stand it - not one bit.

#    Comments [1] |
 Tuesday, January 08, 2008

TFS - ItemExistsException Fix

Oh what a P.I.T.A. this error has been. I received this error today...

Microsoft.TeamFoundation.VersionControl.Client.ItemExistsException: The item $/path/to/myFile.cs already exists. ---> System.Web.Services.Protocols.SoapException: The item $/path/to/myFile.cs already exists. --- End of inner exception stack trace --- at Microsoft.TeamFoundation.VersionControl.Client.Repository.ProcessHttpResponse(HttpWebResponse response, Stream responseStream, WebException webException, XmlReader& xmlResponseReader) at (...)

blah blah blah...

We have two build servers set up at the client where I'm at and I'm in charge of keeping them up and running smoothly.

Build Server 1: Local, same office as where our TFS Server is

Build Server 2: Remote, connects via TFS Proxy Server at the remote location which connects to our TFS server (next to Build Server 1)

 

PROBLEM 


The problem is that I recently moved a project using the Move command in TFS.

The project was moved from a location which was incorrect for our Continuous Integration environment to a location that that was optimal.

Between the time that this move occurred and when the project was altered again, a file was dropped from TFS somehow yet it remained in the project. Not a big deal right? I asked a coworker to add it through Team Explorer. Bam, no problem, done. The file was back, it built correctly on our development machines and we went onto the next task.

Then CC.NET Barfed. It was the error that is in red above.

Robert Horvick had some great insight into this error on this post. Here's what he says:

"At a high level what is happening here is that there are two distinct items which happen to have the same path name (at different points in time, obviously).  When you are labeling TFS sees what you want to put into the label (the new item) and what is already in the old label (the old item) and sees the name conflict.  Since /child:replace means to replace the label on the same item it can't drop the label off the old item which means it can't add it to the new item so it issues this error message."

THANK YOU Robert.

 

SOLUTION


As Robert also stated in that post we have to "unlabel" the file so CC NET can re-label it correctly. We're getting rid of the old label on this file. We do this with the "tf unlabel" command.

tf unlabel 1234 "$/Path/to/myFile.cs"

(where 1234 is the label)

I did this, and then forced a build through CC.NET and it worked! Woo hoo!

UNTIL... the next build, it broke, and I get the same exact error message above.

 

After some research I came to find out that this solution that was getting labeled was a solution that was getting labeled multiple times a day on two separate build servers. We have a common source solution that is shared among many applications (such as security objects, loggers, etc). So while I cleared the label on the one build server, there was still a label that might have been newer on the new build server.

In order to get around this, I had to clear all the labels for that file. Normally this is not something I'd ever want to do, but fortunately this file only had about 4 labels applied to it as it was fairly new and we were not doing anything with those said labels (just cc.net labels). After removing the labels, everything started building just fine.

#    Comments [0] |

TFS Build Not Publishing Web Applications

_PublishedWebsites does not exist?! WHAT?! Huh?

One of our TFS builds was succeeding and a fellow developer noticed that the Web App was not getting copied into the _PublishedWebsites folder of our drop location.

I took a look at our TFSBuild.Proj file and I didn't see anything that stood out. I took a look at a similar project who's output was being copied into the _PublishedWebsites directory and the .proj file matched that of the one that did not work.

Solution

The problem was not in the .proj file, but in the actual .csproj file for the Web Applicaiton Project.

.csproj files ARE MSBuild files and inside of that I saw this:

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!--<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0WebApplications\Microsoft.WebApplication.targets" />-->

The second Build target file was not getting loaded.

This build target file contains a target by the name of "_CopyWebApplication" which takes the output of the web application and copies it to the _PublishedWebsites directory.

I uncommented this line, checked it back into TFS and re-ran my build and my _PublishedWebsites started showing up. :)

My file now looks like this:

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0WebApplications\Microsoft.WebApplication.targets" />
#    Comments [3] |