locked
WCF Net.TCP w/ Callback Interface - Hosted on IIS7.5 Issue RRS feed

  • Question

  • WCF is hosted and operational on IIS 7.5

    Have a test client w/ service reference and am able to 'subscribe' and receive callbacks. Also have a separate 'Service Monitor' that uses net.pipe to display service info (like active subscriptions)

    The callback function is firing twice on both SVC and client side. But the real issue is there are two WCF SVC instances being created per one client connection, one hangs around after the subscription is canceled (added cheesy logging in the SVC side callback event and can see it fire even after client is gone). The instance will continue until I stop it in the task manager (wpw3).

    Attaching VS 2010 to IIS process and setting a breakpoint in the ctor only breaks once when a client is connected.

    FYI: The app pool is Integrated, .Net4, and startmode='ondemand'. Have the WCF set up as website in IIS, not app under a site. Maybe this has something to do with it?

    I do not see this behaviour when hosting the same service in a Windows managed service project.

    Been fighting this for a couple days now w/o success. Any ideas would be greatly appreciated.

    Thank you, Steve


    Tuesday, October 9, 2012 10:48 AM

Answers

  • It all came down to adding a single attribute on the service.

    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

    • Marked as answer by LeoTang Wednesday, October 17, 2012 10:50 AM
    Wednesday, October 10, 2012 12:35 AM