Debugging Self Hosted WCF Services requires Admin Permissions

If you are trying to create a Self-Hosted WCF Service, the host process needs permissions to reserve the base URI used by the service.  If it doesn’t, you’ll get an “AddressAccessDeniedException”. 

image

The fix?  Simple, run Visual Studio as an Administrator.  Hold down the “Shift” key and Right-Click on the Visual Studio icon.  Select “Run as administrator” (if your account is a local admin) or “Run as different user” and enter the credentials for an administrative account:

image

Or, from the Windows 8 Start Screen, right click on the icon, or Live Tile and select “Run as administrator”:

SNAGHTML37c89c

Leave a Reply