none
Reuse type in advanced menu not reusing ServiceContract? RRS feed

  • Question

  • Hey guys,

    I've created a WCF service with the contracts in a separate assembly. I've also created a console app that consumes the webservice with a reference to that contracts assembly. Now if I explicitly use "reuse types in referenced assemblies" in the "Add Service Reference" menu it doesn't use the ServiceContract/Interface of the referenced assembly but just creates it own. Is this right? Yes? Why is this?

    By the way, the DataContracts are working just fine from the referenced assembly, it's just the ServiceContracts.

    Thanks


    Blog: http://jeffreypaarhuis.wordpress.com Twitter: @jpaarhuis

    Tuesday, April 3, 2012 4:32 PM

Answers

  • Hello, this feature only applies to data contract, not service contract. However, since you want to share the same service contract between client and service, you can use the client channel model instead of adding a service reference. Refer to http://msdn.microsoft.com/en-us/library/ms734681.aspx for a sample.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.

    • Proposed as answer by Jeffrey Paarhuis Thursday, April 5, 2012 6:13 AM
    • Marked as answer by Yi-Lun Luo Tuesday, April 10, 2012 12:08 PM
    Wednesday, April 4, 2012 11:53 AM

All replies

  • Hello, this feature only applies to data contract, not service contract. However, since you want to share the same service contract between client and service, you can use the client channel model instead of adding a service reference. Refer to http://msdn.microsoft.com/en-us/library/ms734681.aspx for a sample.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.

    • Proposed as answer by Jeffrey Paarhuis Thursday, April 5, 2012 6:13 AM
    • Marked as answer by Yi-Lun Luo Tuesday, April 10, 2012 12:08 PM
    Wednesday, April 4, 2012 11:53 AM
  • Ok, thats clear. But is this a bug or a feature? When you choose feature, then why is it this way?

    Blog: http://jeffreypaarhuis.com Twitter: @jpaarhuis

    Wednesday, April 4, 2012 12:11 PM
  • It's neither a bug nor a feature. You can think it as a limitation.

    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.

    Thursday, April 5, 2012 2:05 AM