Silverlight and Self-Hosted WCF

I have been working on a project that is based on Silverlight.  It is a large application that performs a variety of tasks, but also needs local access.  Basically, it needs access to scanner in order to scan and upload documents up to the data store.  I had an idea to create a WPF tray application that hosts a WCF Service that Silverlight application can talk to.  Because of WCF restrictions in Silverlight, you have to enable cross domain access in self-hosted WCF service.  There is a variety of posts on the subject, so I am not going to rehash the steps.  You can for example ready about that here.

I thought I came up with a pretty clean solution, and it got tested and worked great.  However, when we deployed it to a customer computers, we had intermittent problems with it.  It worked on soma machines, but did not on others.  We were trapping the errors, and it was reported as cross domain error even though we had all the correct code there to make it work.  Quite a puzzle.  One specific client was running IE 6, and our application was using https.  I pondered on the topic for a while, and on a hunch I added our site to the list of trusted sites in IE.  Voila, the error went away.

I wanted to blog about it, because I could not find anything on the internet that reports the same issue and the same fix.

Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *