Tuesday, January 4, 2011

AddressAccessDeniedException on Windows 7

Trying to host the WCF service that has http end-point on Windows 7 can throw the AddressAccessDeniedException if the process does not have elevated permissions. Visual Studio can be started under the administrative privileges which will provide the required permission to start the service.

Namaskara,

Harsha

WcfSvcHost.exe on x64 machine

Visual Studio 2008/2010 ships with this tool that can help the in quick development and testing of the WCF service. It is a general purpose service host.

When you run this tool with the service built on the x64 machine with the platform target as Any CPU, we may be greeted with the application reporting in essence “WcfSvcHost encountered a critical error with System.BadImageFormatException exception”.

Re-compiling the code with the platform target as x64 (as highlighted below) will help resolve this issue.

image

Namaskara

Harsha