Sunday, March 13, 2011

Problem running WCF service on Windows Vista using Visual Studio

Impact: The project throws AddressAccessDeniedException while opening a service host using host.Open()

Solution: This exception occurs due to the new security settings in Windows Vista. This impacts your ability to run HTTP web services because listening at a particular HTTP address is a restricted operation. By default, every HTTP path is reserved for use by the system administrator. Your services will fail to start giving you an exception. To get rid of this exception follow the steps mentioned below.
  1. Close Microsoft Visual Studio if opened.
  2. Right click on the Microsoft Visual Studio in Start -> All Programs or from the shortcut on your desktop.
  3. Then click on Run as administrator.
  4. Now try to run your WCF project.

Sunday, March 6, 2011

Problem sending exception from webservice to client in WCF

Impact: Web service throws The creator of this fault did not specify a Reason exception

Solution: When you try to throw an exception back to client using the FaultContract() attribute, the web service doesn't send the fault message to the client. Instead it will give you an exception saying 'the creator of the fault did not specify a Reason'. If you are getting the same exception then please follow the steps mentioned below before you come to any conclusion regarding the code that you have written.

  • Open your project(web service) in Visual Studio.
  • Click on Debug in the menu bar.
  • Then click on Exceptions...
  • Uncheck the checkbox next to Common Language Runtime Exceptions, under the category User-Unhandled.
  • Click OK and now try to run your project.