且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过WCF公开Winforms应用程序内部

更新时间:2022-11-16 23:04:12

此处的问题是WCF服务主机在托管服务,而不是应用程序本身.这导致应用程序在单独的ApplicationDomain中运行,进而导致创建新的单例.改用自托管解决了这个问题.

The problem here was that WCF Service Host was hosting the service, rather than the application itself. This caused the application to run in a seperate ApplicationDomain, which in turn caused a new singleton to be created. Switching to self-hosting solved the problem.