none
System.InvalidOperationException: Operation is not valid due to the current state of the object.

    Question

  •  

    Hi all, 

                 I have started working with wcf services in silverlight 2. i have created the proxy the usual way and when i call a method of the

     service i get the following error .

        System.InvalidOperationException: Operation is not valid due to the current state of the object.

     I have changed the binding to basicHttpBinding in web.config. 

     can any one help me out.

    Thanks in advance 

     

     

    Tuesday, April 08, 2008 6:46 AM

Answers

  • You will need to have a clientaccesspolicy.xml file in the WCF Service, so that the silverlight application can access the same.

    To enable a Silverlight control to access a service in another domain, the service must explicitly opt-in to allow cross-domain access. This is done in a client access policy  xml file. For more details refer the link below.

    http://msdn2.microsoft.com/hi-in/library/cc197955(en-us,VS.95).aspx
     

    Regards

    Vijith 

    Wednesday, April 09, 2008 2:33 PM