WCF extensions without including the assembly version

前端 未结 3 1777
南笙
南笙 2021-02-05 22:37

As discussed here, I\'m trying to add a WCF endpoint-extension; I\'ve got it working, but I need to include the full assembly details:


    <         


        
相关标签:
3条回答
  • 2021-02-05 23:12

    AFAIK, it's unfortunately not possible to use partial names in the behaviorExtensions section. Strangely enough it's only for the behaviorExtensions section. For example, you can do bindingElementExtensions without full assembly name. Just looks like whoever wrote that configuration section implementation didn't allow for partial name loading where as the others did. I haven't checked to see if this is remedied in .NET 4 yet.

    0 讨论(0)
  • 2021-02-05 23:17

    Just to reiterate what @wojo noted. If you have come here looking for the answer to

    "cannot be added to this element.  Verify that the extension is registered in the extension collection at system.serviceModel/extensions/behaviorExtensions."
    

    and you are now running .Net 4 then REMOVE the assembly Version,Culture,PublicKeyToken from the behaviorExtensions add tag. all that is needed (worked for me) was the full namespace/class followed by the assembly.

    0 讨论(0)
  • 2021-02-05 23:21

    Have you thought about using the WCF facility for Windsor? It automagically wires extensions to service implementations when they're both registered with the container. Of course, Windsor doesn't require full assembly names. If you're not using Windsor, I'm sure you could fairly easily build an equivalent framework for other IoC containers.

    0 讨论(0)
提交回复
热议问题