Jun 13, 2009

Debugging WCF hosted on IIS

Image representing Microsoft Silverlight as de...Image via CrunchBase


Something trivial as debugging a WCF hosted on IIS eventually cost me hours of googling and digging into VS2008. Lot of lessons learnt though.

In brief:
Built a WCF and a Silverlight app to connect to it.

On trying to run both of them out of development web server supported by VS resulted in error

This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent.
After digging for while and repeatedly reading the basic requirements to have crossdomain.xml and clientaccesspolicy.xml, this article gave an organized summary with examples on crossdomain. Again, it didn't work. The solutions recommended having either of the crossdomain.xml and clientaccesspolicy.xml files in the app folder or the www root folder. It really didn't work in my case. It started working when placed both the files in root and app folder. Still, not sure if that made it work. Worth a try and different from all the solutions i came across.

Error 2:

Trying to debug the WCF hosted on the IIS through VS.NET started throwing the error "The following module was built either with optimizations enabled or without debug information"

I was sure, the modules were built with debug mode and optimizations turned off. After searching for while, the below url provided ways to debug further. The articles talks about attaching to w3 process and using VS.NET to check the availability of debug information.

http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/3d99bf8b-dd32-4562-ab9b-8f63982ec57c

http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic49328.aspx

Reblog this post [with Zemanta]

No comments:

Post a Comment