Tag: wcf extensions

为什么没有find我自定义的WCF行为扩展元素types?

我有一个包含两个项目的解决scheme。 一个项目是一个ASP.NET Web应用程序项目,一个是类库。 Web应用程序具有对类库的项目引用。 这两个都没有强烈的名字。 在我称为“Framework”的类库中,我有一个端点行为(一个IEndpointBehavior实现)和一个configuration元素(一个从BehaviorExtensionsElement派生的类)。 configuration元素是我可以通过configuration将端点行为附加到服务。 在Web应用程序中,我有一个支持AJAX的WCF服务。 在web.config中,我将AJAX服务configuration为使用我的自定义行为。 configuration的system.serviceModel部分非常标准,如下所示: <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="MyEndpointBehavior"> <enableWebScript /> <customEndpointBehavior /> </behavior> </endpointBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> <services> <service name="WebSite.AjaxService"> <endpoint address="" behaviorConfiguration="MyEndpointBehavior" binding="webHttpBinding" contract="WebSite.AjaxService" /> </service> </services> <extensions> <behaviorExtensions> <add name="customEndpointBehavior" type="Framework.MyBehaviorExtensionsElement, Framework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/> </behaviorExtensions> </extensions> </system.serviceModel> 在运行时,这是完美的。 启用AJAX的WCF服务正确使用我的自定义configuration的端点行为。 问题是当我尝试添加一个新的AJAX WCF服务。 如果我做Add – > […]