【发布时间】:2012-08-21 18:18:14
【问题描述】:
我正在尝试使用 .Net Remoting 来获取我在 Windows 服务线程中使用的变量的值。
TcpChannel tcpChannel = new TcpChannel(9998);
ChannelServices.RegisterChannel(tcpChannel, false);
Type commonInterfaceType = typeof(MyNameSpace.Core.Engine);
RemotingConfiguration.RegisterWellKnownServiceType(commonInterfaceType,
"CopyFilePercentage",
WellKnownObjectMode.SingleCall);
myEngine = Engine.EngineInstance;
myEngine.Start();
但每次我使用客户端获取该值时,都会创建一个新线程并返回一个空字符串。
知道为什么会发生这种情况还是我做错了什么?
提前致谢,
米格尔·德·索萨
【问题讨论】:
标签: c# windows-services remoting