Well well well, I came across a gem of a hurdle this morning whilst working on a new Windows Phone 7 application that had me (and could have you) scratching your head for a while.

The app I am working on makes use of WCF Services and when I came to create the service that is where I hit the hurdle.

The crux of the problem came down to having both Visual Studio 2010 and Expression Blend 4 open at the same time on the same solution, which is how I often work, swapping between the 2, Blend for UI work and Visual Studio for the code.

Anyway, on to the problem.

So I was working away in Blend 4, created my listbox and template to display the search results and then it came time to wire up the WCF Service.

So I flipped back across to Visual Studio, clicked Add Service Reference, clicked Discover, my reference appeared and I clicked OK.

All seemed to go well.

However, when I went to add the code my service could be nowhere to be found by Intellisense. Whaaaaat???

So I ferreted about for a bit and checked out the Reference.cs file and lo and behold it was empty and this was definitely not right.

So I tried re-adding the service a few times, shut down Visual Studio, tried again and still nada.

It was then that I though to switch over to Blend 4 and there waiting for me patiently was a dialog saying it wanted to refresh the solution.

Aha, that was the problem. It was preventing Visual Studio from finishing its job properly.

Once I shut down Blend 4 (could have just dismissed the dialog) and re-added the reference in Visual Studio all was good in the Universe again.

Hope that helps another ‘young player’ out there that gets caught in the same trap.

BondiGeek