views:

1941

answers:

2

I've created a WCF service and added it to an existing Silverlight application that I am working on.

When I run the silverlight application in debug mode it fails when I reference the WCF web service.

Unrecognized element '' in service reference configuration. Note that only a subset of the Windows Communication Foundation configuration functionality is available in Silverlight.

After searching around apparently the following line is causing the app to fail:

<transport>
   <extendedProtectionPolicy policyEnforcement="Never" />
</transport>

After removing the above lines everything works. What is the issue here? Should I believing this code in and configuring something else?

+2  A: 

Which version of silverlight do you use? <extendedProtectionPolicy> is available only in Silverlight 3.

There are some issues in running wcf + silverlight on Windows 7. [http://blogs.msdn.com/silverlightws/archive/2009/04/05/some-known-issues-in-sl3-beta.aspx]

Issue: On Windows 7 Beta, you might encounter the following error when generating a proxy: "The element 'httpTransport' cannot contain child element 'extendedProtectionPolicy' because the parent element's content model is empty".

Workaround: On Windows 7, when you use the Silverlight-enabled WCF Service item template, an element may be generated in Web.config. This element is not supported by Silverlight. Simply remove the element from Web.config and try regenerating the Silverlight proxy.

HTH

Alexander K.
Silverlight 2 application is hosted on Windows 7RC
jdiaz
I've seen the same thing on Windows 7 RC, not sure why.
James Cadd
A: 

the workaround is not good enough, i have to modify the web.config file every time i create a silverlight-enabled wcf service

Kevin Yang