0
votes

I have a WCF service hosted as Managed application. It act as mediator between a WPF application and ASP.net application. WPF application hosts ASP.net application in Webbrowser control. When user tries to close webbrowser control wpf application calls wcf service to check whether web application is busy. WCF does a callback to web application which registers itself when it starts up. But the callback never succeed as the second web application worker process crashes. The service Contract is as follows:

[ServiceContract(CallbackContract = typeof(IToolStatusNotifierServiceCallback))]
public interface IToolStatusNotifierService
{


    [OperationContract(IsOneWay = true)]
    void SubscribeToCanShutDown(string toolId);


    [OperationContract(IsOneWay = true)]
    void UnsubscribeToCanShutDown(string toolId);

    [OperationContract]
    void CanShutDownTool(string toolId);
}

THe callback contract as follows:

 [ServiceContract]
public interface IToolStatusNotifierServiceCallback
{
    [OperationContract]
    ToolCloseResponse OnCanToolShutDown(string toolId);

}

Here when web application starts it calls SubscribeToCanShutDown and when wpf application needs to query the web application it calls CanShutDownTool. In the same method the callback happens to web application. But callback just crashes the worker process. This works fine in development machine but fails on deployment machine both haveing .net framework 4 I have tried setting UseSynchronizationContext=false and making callback asynchronous but nothing solves the problem. Thanks for helping

1
The issue was resolved when switching to nettcpbinding. Earlier i was trying with Named Pipe. - user853390

1 Answers