Because of the way that Windows Vista works with User Account Protection even if you are running on Vista as an Administrator when you come to run a simple WCF service application that listens on, say;
You may well encounter the “Your process does not have access to this namespace” error which is basically saying that you’re trying to register interest with HTTP.SYS but you don’t have the permissions because this is an administrative function and even if you’re an admin you’re not going to get that to work on Vista.
There are two ways around it that I can think of.
One is to run “elevated” but that means you’ll have to run VS 2005 elevated if you want to do debugging so that’s perhaps not a good idea.
The second (proper) solution other was given to me when I wrote this post here on HTTPCFG.EXE.
Essentially, you need to run elevated for a moment whilst you use HTTPCFG.EXE to set the ACL on that portion of the namespace that you’re trying to register (in my case http://+:8080/myNamespace) to allow your code to do those registrations. Once the ACL is set you can forget about running elevated.
Dominick has a great tool over here for helping you generate the right syntax for HTTPCFG.EXE – he even gives you the source code which is a very nice use of all the new ACL bits within .NET Fx 2.0.
I found that I couldn’t get the proper installation of HTTPCFG.EXE to work on Vista because it thinks it’s the wrong OS so I just copied the tool from an XP installation and that seemed to work fine for the Vista December CTP.