Friday, August 28, 2009

ServerTooBusyException in WCF, possible cause

I wanted to post this confusing error and solution in case this can help anyone else.  Here is my general situation:

1. I was testing my WCF service hosted on a remote IIS server.  I had an identical IIS setup on my local development machine, and I wanted to switch to use it instead for better debugging support. 

2. When I ran the exact same service-calling code on my local machine, service calls always hit the ServerTooBusyException exception.  I checked my local IIS setup, confused that I was getting a different result when all of the virtual directories, ports, bindings, etc. were identical to the remote server.  I manually accessed my service’s URL in a local web browser, i.e. http://localhost/MyService/MyService.svc.  I got the error:

Service Unavailable


HTTP Error 503. The service is unavailable.

Huh?  Not very descriptive.  And being a newbie, I have had no luck following the convoluted steps of getting any sort of service trace logging to work – and I wasn’t even sure if this would help.  (As an aside, PLEASE comment if you know how to enable the type of logging that ultimately would have revealed this problem.)

3. Finally I found a vague comment on a forum regarding changed credentials, and it dawned on me: The account associated with the app pool I was using had had its password changed recently, and I hadn’t updated it on my local server to reflect this.  Once I re-set the credentials for the app pool user, everything worked perfectly.

 

I hope this post saves a headache or two.

Friday, August 7, 2009

Code Analysis / Team Foundation context menu items missing!

I had an issue recently in which my Team Foundation (2008) enlistment appeared to be partially corrupt.  Some of the symptoms:

1. My “Work Items” folder had a red ‘x’ next to it permanently; I could never connect to my work items on my main PC (but I could from other PCs).

2. When right-clicking on a Code Analysis warning in the Error List panel of Visual Studio, I didn’t get the usual options of “Create Work Item” and “Suppress Message(s)”.

3. Some of the Team menu items were missing, or their sub menu items were greyed out, and displayed error messages such as “value does not fall within the expected range.”

I tried all sorts of painful, time-consuming solutions, even uninstalling/reinstalling everything, but ultimately the solution was simply to delete my local app data Team Foundation Cache folder, located here:

%localappdata%\Microsoft\Team Foundation\2.0\Cache

I hope that someone finds this and it saves them hours of headache.