views:

272

answers:

1

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?

A: 

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:

  <system.runtime.remoting>
      <application name="MyService">
        <service>
          <wellknown type="MyAssembly.MyServiceProxy, MyService" objectUri="FrontdeskSyncService.rem"  mode="Singleton" /> 
        </service>
        <channels>
          <channel ref="ipc" portName="server" authorizedGroup="Everyone">
            <serverProviders>
              <formatter ref="binary" typeFilterLevel="Full" />
            </serverProviders>
          </channel>
        </channels>
      </application>
  </system.runtime.remoting>
Lachman