Wednesday, May 26, 2010

Browser Cache - Your Friend and Foe

Because we use a ton of Static Content (e.g. Java Script, CSS, HTML) in our new application, the last few years I've been involved in dealing with Internet Browser Caches. We cache our Static Content locally so the users don't have to download it every time they hit our site. While this made us very fast, we were having perpetual problems with invalidating browser cache when Static Content files change.

We had a number of architectural meetings about it with a number of suggestions on how to deal with it. URL re-writing, ETAGs, unique file names were all brought up. What we ended with was a directory versioning scheme where we inject a unique number into the base URI path and then update an authority file that orchestrates the pages, injecting the unique number. During deployment the files are staged under the unique number on the web server file system.

If you look a look at Google's home page, you can see they do something similar. Here is a Java Script file they are including on their home page. Looks like they took the idea and put it on steroids to me.

http://www.google.com/extern_js/f/CgJlbhICdXMrMAo4aEAILCswDjgPLCswFjgWLCswFzgHLCswGDgFLCswGTggLCswHTgyLCswJTjKiAEsKzAmOAssKzAnOAQsKzAqOAQsKzArOAwsKzA8OAIsKzBAOBAsKzBBOAUsKzBFOAEsKzBOOAUsKzBROAIsgAIT/0_HiDVMVc9k.js

Bing did something similar, but is more similar to what we do. Bing's number kind of looks like a TFS changeset number ;)

http://www.bing.com/fd/sa/0311190804/Shared.js

Since I've spent most of my life on the server side, I never realized how many gains you get from using Browser Cache effectively. Here are a couple of stats I took off our site while looking at the caching.

With the browser cache empty.
One 18.1 KB File = 172 MS

With the browser cache populated with the file.
One 18.1 KB File = 31 MS

I guess the lesson learned is using Browser Cache is great if you know enough on how to invalidate the cache when you need to push a new version of the code.

Tuesday, March 30, 2010

Enabling the “Send Selection in Mail”

After installing VS 2008 and Team Explorer, a colleague of mine asked why she couldn’t see the “Send Selection in Mail” feature as the rest of us could. Here is why.

1) First, you need VS 2008 SP1. SP1 is key here.
2) Second, you need Power Tools.
3) Third, you need to make sure “.NET Programmability Support” is configured.

If you do 1-2, but not three, you’ll get an error that says “TF242403: To send a query or work items, you must install Outlook 2002 or later” even if you’re running Outlook 2003 or Outlook 2007.

Tuesday, March 23, 2010

“A version of Microsoft Visual Studio that is incompatible with this one”

A trusted colleague of mine recently tried to open a VS 2008 solution on his machine. When going to File – Source Control – Open from Source Control and double clicking on the Solution File, he got the message "the project [solution name] cannot be opened from source control because it was created by a version of Microsoft Visual Studio that is incompatible with this one."

We first though it was that he didn’t have VS 2008 SP1 installed. (I have SP1 installed and it worked fine for me.) However, even after installing VS 2008 SP1 he continued to have the problem.

We’re not sure what was corrupted, but after deleting his workspace and recreating it, the error went away. So it must have been a corrupted workspace, or something along those lines, that caused the issue.

It’s funny in technology how often, when in doubt, nuke and pave works.

Wednesday, March 17, 2010

Visual Studio 2008 SP1 with Team Explorer Hanging

I’m not sure when it started, but my Visual Studio 2008 SP1 has been hanging on my lately. Looking in Task Manager, I see devenv.exe*32 is consuming 99% of my CPU. My life has been within Java lately (via Teamprise’s Eclipse Plug-in) so I haven’t opened VS much, however, winds are changing a bit and so I have it open more often now than before. And the hanging has been getting on my nerves.

I’m not 100% sure of the cause, by I think it might be the Team Members (working….) that I see sporadically on a few of the ~24 Team Projects I have on my list. My guess is that is causing some issues.

I don’t use the Team Members feature of TFS so I’ve disabled it following these instructions. I just did the first step and it seems to have stopped the hanging for now.

So far so good, so hopefully I’m not speaking too soon ;)

Tuesday, March 16, 2010

Connecting Visual Studio 2008 SP1 to TFS 2010 RC

After my colleague installed TFS 2010 RC to our DEV system, I mustered up the courage to try and connect via Visual Studio 2008 SP1. Not much luck starting out.

I don’t remember the exact error, but it was something in regards to "Unable To Connect." Thanks for letting me know.

After reading through a few blogs and discussion boards (most of them referenced the need for Visual Studio 2008 SP1 which I already had), I came across this one which at the bottom shows you a registry edit you can make to add the TFS 2010 to your VS 2008 SP1 server list. After trying this, I got a bit farther and finally a meaningfully error message.

When trying to connect, we got "You Must Update Your Client with the Forward Compatibility Update.." I couldn't copy/paste the link in the dialog window (sigh), so I got out my pencil and paper to write it down. Here it is for you so you don't have to repeat the same archaic steps.

After installing this package, I was able to connect by putting in http://$server-name:8080/tfs/$collection-name

Friday, March 12, 2010

Out of Memory Exceptions in Ant

While trying to get some new build machines cooking, a colleague of mind forced me to notice that Java 1.6 on Windows must default it’s heap size to 64 megs. When running an Ant job, he was getting and Out of Memory Exception when trying to compile JUnit reports via the JUnitReport Task.

I figured out the default heap size by opening JConsol and checking Max setting on the Memory Tab. Sure enough, without any Max Setting it was 64m.

What got this whole thing confused was that we were setting a larger heap (1.6gig) on the JUnit execution. That is, when JUnit forked out for its own VM to run on, it used 1.6 gigs which turns out to be more than enough. However, the Ant process was running at 64m (the default remember) and giving us fits when Ant’s JUnitReport, which does not fork itself, was trying to compile the HTML reports.

To fix this, we simply upped Ant’s Max Heap Size to something larger (e.g. –Xmx512m) by setting ANT_OPTS=–Xmx512m as an Environment variable on the server. (As a side note, remember you need to refresh the environment of any tooling needing to use this new variable. Examples are recycling a process like Team Build or closing and restarting your command prompt). Once we did this all was better.

Free coffee is coming my way!

Monday, November 09, 2009

Thoughts on Microsoft's purchase of Teamprise

Since I was the first to bring TFS/Teamprise into my company, I've been asked to comment on the Microsoft/Teamprise deal. Though Teamprise and Microsoft have seemed to have a tight relationship all along (and users have benefited from this), I believe combining them makes good business sense. Why? Let me explain.

Large companies, like the one I work for and partially own (tongue and cheek here as I own a small portion of stock), want vendors who have consolidated tool sets that fit their development ecosystems. I've only worked for one company, but I'm guessing that most organizations have two large pillars: Java and .NET. What we don't want to do is buy one tool for our .NET folks and another for our Java folks. Often, a single person works in both technologies so buying two licenses doesn't make economic sense.

TFS along with Teamprise has allowed us to satisfy the needs of developers working in .NET and those working in Java on Linux desktops. One sticking point however has been that we have two vendor relationships to manage. While this has never bothered me much, our procurement department has mentioned that they like to limit the touch points. And since they deal with the myriad of legal contracts and license management (a significant pain point for large organizations), I can understand their concerns.

Buying Teamprise makes TFS a more attractive solution for companies with multiple development ecosystems. Three years ago when I approached our vice president with the TFS proposal, he questioned why Rational could give us everything we needed while TFS required us to buy an additional product. This concern was allayed by other factors (ease of use, migration path, price, etc.,) but it would have been an easier sell if Microsoft had a cross-platform solution back then. I can only imagine this purchase makes TFS more attractive to those on the fence about what product to go with.

Lastly, a note to Microsoft's leadership: In my 12 year career, Teamprise from top to bottom has been the easiest company to work with. Everything from support (Tonya Nunn is great) to development leadership (Martin and Edward Thomson of course), we've had nothing but positive experiences with them. I hope you leverage their close, personal approach to working with customers. They are every bit as important (if not more) to Teamprise's success as the software itself.

Wednesday, November 04, 2009

"You are not logged into Windows Live Messenger"

After a user (a business representative user) installed the October Power Tools, they started getting a message saying "Team Foundation Error: You are not logged into Windows Live Messenger" when opening VS.NET 2008 Team Explorer.

I didn't look into it much (too many other things going on), but I guess these steps fixed it (or disabled whatever was causing the issue).

1. Open VS 2008 and wait until Team Members is not "working..."
2. Right-click on it and select Personal Settings
3. Under Collaboration, click Change
4. On the opened dialog select None and click OK
5. Click OK once again


I got them from this forum page.

Wednesday, July 15, 2009

"TF84037: There was a problem initializing the Microsoft Excel Team Foundation AddIn"

We seem to have a number of people who get the error "TF84037: There was a problem initializing the Microsoft Excel Team Foundation AddIn. Re-installing the Team Foundation Client may be required." Which usually boils down to the user not having .NET Programmability Support enabled on their Office installation. Here are some plagiarized instructions I stole from someone else who I can't remember who. Thanks to whoever I took these from.

It looks like Office 2007 .Net programmability support is not installed. You need to modify your installed version of Office and install this option. I thought we had a better error message for this...
1. In Add/Remove programs, locate your Office application and select it.
2. Click on the 'Change' button
3. Select 'Add or Remove features' and click 'next'
4. Select 'Choose advanced customization of applications' and click 'next' OR select something like 'Add .Net programmability support'.
5. In the tree view, expand 'Microsoft Office Excel' and make sure the .NET Programmability Support option is set to 'run from my computer'.
6. Click 'update'.

Tuesday, July 07, 2009

Slow "Get" issue resolved

Three or four months back we decided to move our build systems from a dedicated virtual machine (VM) farm to the company supported VM farm in the data center. The data center infrastructure had all the bells and whistles (support, backups, redundancy, etc.,).

Everything worked well with the exception of the Gets. Our Gets were taking between 5-10 times longer than in our dedicated farm. We thought it might be a hardware issue, but the new VMs had more memory, more processors, sat physically closer to our TFS server, etc. What the heck?

I spent a good 2-3 days running tests and engaging experts including Teamprise and Microsoft. (I also gained some gray hair.) No such luck getting it figured out.

Turns out my colleague ran into a guy who was having similar issues after migrating to the data center VM farm. Turns out, the data center VM farm was running a new version of our virus scanning software. The real-time scanning must have been checking every file. Once we turned that off, our Gets were significantly faster in the data center VM farm.

What I still don't understand is that the Gets were taking abnormally longer on JAR files (e.g. mac.jar) compared to other binary files (e.g. mac.msi). I'm thinking that since a Jar file could be setup as an executable (I think that is possible in Windows), the virus scanner was spending extra time on those. This is just a hunch.

So if you're running into performance issues with your TFS Gets, try disabling your virus scanner (just for testing of course) and see if that is the cause.