locked
Failed to connect to an IPC Port: the system cannot find the file specified RRS feed

  • Question

  • I'm getting a "Failed to connect to an IPC Port: the system cannot find the file specified"  exception everytime "connection.SetCredentials" function is called.   This only happens on two machines out of the entire company.   Can someone tell me what I'm doing wrong?    Thanks! 

            public static void InitializeService(CASUserConnectionParams ccp, SessionManagerResponseData cachedResponse, int sessionTokenExpiry)
            {
                RegisterIpcChannelAndService();
                string objectUri = String.Format("ipc://{0}/CASConnection", System.Diagnostics.Process.GetCurrentProcess().ProcessName);
                ICASConnection connection = (ICASConnection)Activator.GetObject(typeof(ICASConnection), objectUri);
                connection.SetCredentials(ccp, cachedResponse, sessionTokenExpiry);
            }
    
    
            private static void RegisterIpcChannelAndService()
            {
                Dictionary<string, string> props = new Dictionary<string, string>();
                props["portName"] = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
                props["authorizedGroup"] = new SecurityIdentifier("S-1-1-0").Translate(typeof(NTAccount)).ToString();
                BinaryClientFormatterSinkProvider clientSink = new BinaryClientFormatterSinkProvider();
                BinaryServerFormatterSinkProvider serverSink = new BinaryServerFormatterSinkProvider();
                serverSink.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
                m_ipc = new IpcChannel(props, clientSink, serverSink);
                ChannelServices.RegisterChannel(m_ipc, false);
                RemotingConfiguration.RegisterWellKnownServiceType(typeof(CASConnection), "CASConnection", WellKnownObjectMode.Singleton);
            }
    


    • Moved by Bob Shen Thursday, November 29, 2012 9:31 AM (From:Visual C# General)
    Wednesday, November 28, 2012 10:01 PM

All replies