WCF Quick Start Guide

|

WCF has been my focus for a week or so now and I have not seen many "how to just get something up and running quickly" articles out there. So figured I'd write one. This is a step by step guide of how to get a self hosted WCF "Echo" application up and running in as few steps as possible. In terms of services, for me anyway, the "Echo" service has replaced the "Hello World" service in that it returns what you sent, a little more useful in a service that returning nothing to the caller.

I'll be doing this in C# 2.0, which is required by WCF, and I assume that you're using Visual Studio 2005 – however, this will work just as well using any of the express products and even just Notepad and a compiler. I also assume that you already have WinFx on your machine (installed by default on Vista and you can get it from here if you're working in XP).

On with the show, here's a 20 step guide which should take you about 10 minutes to get up a running. I'll also be using this as the base implementation for future articles (more...)

3 comments:

John Powell said...

Great article! The instructions where quite easily and now the client/host compile and run, I can pick it apart and play with it.

Quick question: my .Net 3 libraries are not in my add references .Net list and I have to hunt for them on my drive (Windows/Framework.....), have you see this before?

Paul said...

I have not come across this problem with the WinFx libraries specifically but I have added custom assemblies to the list before; looking at my configuration in the registry I can see that I have a reference in there to all W*F stuff.

Check the following reg key on your machine and see if matches:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\MyAssemblies]
@="C:\\Program Files\\Reference Assemblies\\Microsoft\\Framework\\v3.0"

Alternatively you might want to look on the help sections of the WinFx support pages.

Hope this helps.

-PJ

Paul said...

UPDATE: This actually assumes that you have installed the Visual Studio Extensions for .Net Framework 3.0? (it's a CTP release at the minute - the framework is fully baked it's just the tooling support is still in CTP)

If not, that will be source of your problems. You can get the download from here.

-PJ