WCF Setup Problems
WCF has to be one of the most frustrating technologies I have ever used. The problems I encountered tonight were in the setup. Like most things development, the trick is in the setup. Unfortunately, I spend a lot of time tweaking the settings on my new development machine install, but I never remember or even note down the tweaks I made to get things to work. So when I rebuild my machine, I am back to square one.
The WCF configuration has too many things that not only look the same, but the declarative nature – while flexible – in most cases is just a pain in the ass and I found it easier to simply hard code the values as in my experience, they rarely change.
Anyway, setting up my WCF IIS host on a new development machine proved to be more involved than I initially credited it would be.
When setting up the IIS host for a WCF library you will need to create an SVC file. But, this file extension may not be recognised by IIS – making things ‘tricky’. So here are some things to look out for in order:
- Try installing the ASP components from the Windows Components in Programs & Services.
- Try ServiceModelReg -ia to install all the WCF components onto your machine.
- Try asp net-regiis -i to install the handler configurations to IIS.
- Sometimes you get a problem where you do not have permissions to run the web application from the current – normally – default application pool. So try setting the user account to LocalSystem in IIS for the corresponding application pool.