Vista 中的 .net 远程处理
我有一个通过 .net 远程处理与 wndows 服务通信的应用程序。
在 XP 下这一切都很好,但是当我在 Vista 上运行相同的代码时,我得到了异常,
System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8969
Server stack trace:
at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(AddressFamily family)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
我尝试关闭防火墙,在与登录用户相同的用户上下文中运行该服务,但无济于事。
Vista 中是否存在不允许通过 .net 远程处理在服务和用户应用程序之间进行通信的问题?
还有其他人看过这个吗?
I've got an application that communicates with a wndows service via .net remoting.
Under XP this is all fine but when I run the same code on Vista I get the exception
System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8969
Server stack trace:
at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(AddressFamily family)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
I've tried turning the firewall off, running the service in the same user context as the user that is logged in to no avail.
Is there something about Vista that doesn't allow communication between services and user applications via .net remoting?
Has anyone else seen this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从来没有为此想出一个解决方案。 但我没有使用 tcp 进行远程处理,而是使用 .net 2.0 附带的 ipc 协议(这是从 1.1 转换而来的项目)。
指定授权组可以解决此问题:
I never came up with a resolution for this. But instead of using tcp for remoting, I used the ipc protocol that came with .net 2.0 (this was a converted project from 1.1).
Specifying the authorized group got around this issue: