简体   繁体   English

来自ASP.NET客户端的WCF回调使ASP.net辅助进程崩溃

[英]WCF callback from asp.net client crashes ASP.net worker process

I have a WCF service hosted as Managed application. 我有一个WCF服务托管为托管应用程序。 It act as mediator between a WPF application and ASP.net application. 它充当WPF应用程序和ASP.net应用程序之间的中介。 WPF application hosts ASP.net application in Webbrowser control. WPF应用程序在Webbrowser控件中承载ASP.net应用程序。 When user tries to close webbrowser control wpf application calls wcf service to check whether web application is busy. 当用户尝试关闭Web浏览器控件时,WPF应用程序将调用WCF服务以检查Web应用程序是否繁忙。 WCF does a callback to web application which registers itself when it starts up. WCF对Web应用程序进行回调,并在启动时对其进行注册。 But the callback never succeed as the second web application worker process crashes. 但是,随着第二个Web应用程序工作进程崩溃,回调永远不会成功。 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. 在这里,当Web应用程序启动时,它将调用SubscribeToCanShutDown,而WPF应用程序需要查询Web应用程序时,它将调用CanShutDownTool。 In the same method the callback happens to web application. 以相同的方法,回调发生在Web应用程序上。 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. 这在开发机器上工作正常,但在具有.net Framework 4的部署机器上均失败,我尝试设置UseSynchronizationContext = false并使回调异步,但没有任何方法可以解决问题。 Thanks for helping 感谢您的帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM