WPF vs. UAC
If you're having a problem running WCF services on top of Windows Vista, especially any access denied exceptions, it might be caused by UAC blocking the operation. UAC turns a user from Administrators group to a standard user, unless you use the built-in Administrator account (which is nowhere to be found in 5456).
To make an application request UAC permission to elevate to Administrator privileges, you should add a MANIFEST file to the install (or build) directory of the application. A MANIFEST file is an XML file named exactly like the application EXE file plus a .MANIFEST afterwards. For example, if your application EXE is “HelloWorld.exe“, the manifest should be named “HelloWorld.exe.MANIFEST” and be placed on the same directory.
The content of this MANIFEST file is just plain XML, as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator">
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
That MANIFEST file will require the application to be run with Administrator privileges and on Windows Vista machines will display UAC permission dialog.
When developing a Solution, you will also encounter this errors even if you have created the MANIFEST file. This is because by default Visual Studio will run without Administrator privileges. The application you built runs from Visual Studio which means it uses the privileges of Visual Studio. To elevate Visual Studio, just right-click on the shortcut and choose Run as Administrator.