New methods not showing up in WCF Test Client? Are you using IIS Express and did you move your code to a new directory without deleting the old one?

I gave the answer to my problem of today in the title…

I work on multiple projects. But we also recently changed our source control provider from SVN to Git. If I haven’t touched a code-base for months, I don’t bother to clone the new repository until I need to work on it. That’s what happened today.

I cloned the repository for this particular solution, and started working on it. I added new code to a few projects, including one new WCF method. Tested everything else, then when I wanted to test the WCF service changes, two things went wrong:

  1. Pressing F5 launched my browser rather than the WCF Test Client.
  2. After I figured out how to fix the first issue, the newly added method was missing.

To fix the first issue, all I had to do was right-click the source file containing my service contract and choose Set As Start Page.

Then off to Google and StackOverflow, but I found nothing that solved my problem.

In my case, what happened was IIS Express was still pointing to the old contract, in the source folder that I used before switching to Git. I confirmed it by trying to move that directory and saw the usual Windows error message telling me that directory was in use.

To fix the issue, I had to manually edit the applicationhost.config file found in:
C:\Users\[My username]\Documents\IISExpress\config

Fixing it was just a matter of searching for my project name, and right away I saw the paths pointing to the wrong directory.

I hope this helps somebody who has a similar problem…

Advertisements

About Jerome

I am a senior C# developer in Johannesburg, South Africa. I am also a recovering addict, who spent nearly eight years using methamphetamine. I write on my recovery blog about my lessons learned and sometimes give advice to others who have made similar mistakes, often from my viewpoint as an atheist, and I also write some C# programming articles on my programming blog.
This entry was posted in Programming and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s