I am having a configuration issue with a server trying to get WCF services working. The compiler does not like enablewebscript as an option in a behaviour.
Below is the section of web.config declaring the element
<behaviors>
<serviceBehaviors>
<behavior name="metadataAndDebug">
<serviceMetadata
httpGetEnabled="true"
httpGetUrl=""/>
<serviceDebug
httpHelpPageEnabled="true"
includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="AutoCompleteGet">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="MyApp.Webservices.AspNetAjaxBehavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
</behaviors>
and the error reported by the compiler.
Parser Error Message: Invalid element in configuration. The extension name 'enableWebScript' is not registered in the collection at system.serviceModel/extensions/behaviorExtensions.
I have the following information on the server:
– Windows Server Web Edition Service Pack 1
– .NET Framework 3.5sp1 installed
– Microsoft AJAX Extensions v1.0 installed
Note: I have only just turned on the WCF Activation in .NET Framework 3.0 this morning (as this is the first use of a WCF service on that server). It is after this activation that the error began. Prior to the activation, the service returned the expected 404 error message.
Any thoughts on where to look, and why the installed service 3.5 framework appears not to be used?
(I know this is an oldish question, but anyway – just had the same issue myself at a client, came across your unanswered question via a Google search, so…)
Some other sources I’ve seen suggest it relates to WCF having been uninstalled (with the ServiceModelReg.exe -u command). As it’s not my server I’m working on, I don’t know if this is the case, but that specific issue can be worked around by registering the behaviour extension manually in your web.config:
Chances are if that’s missing though, other stuff will be – you may want to check out the machine.config on a machine you know to be working and take the entire section – here’s mine for reference:
Of course depending on the reason for this being missing in the first place, can’t guarantee it will fix it. Good luck…