Search code examples
wcfmef

MEF and Wcf client proxy


I'm wondering if it is possible to EXPORT an WCF client proxy to use IOC with MEF. And how to do that ?To make the wcf client proxy i used "add service reference". Any suggestions ?

Thanks for help.


Solution

  • Since the class is generated, you have two solutions :

    1) you can edit the class and add the MEF export attribute, but it's not a good practice to modify generated classes

    2) you can copy the generated class and create a new one with that, on which you have a total control and can add the MEF export attribute.