日期:2014-05-17 浏览次数:20453 次
protected override void OnStart(string[] args) { try { StartRemoting(); } catch (Exception ex) { File.AppendAllText(string.Format("E:\\log\\page\\{0}.txt", DateTime.Now.ToString("yyyy-MM-dd")), DateTime.Now.ToString() + ex.Message + "\r\n"); } } /// <summary> /// 启动remoting服务 /// </summary> private void StartRemoting() { try { HttpChannel channel = new HttpChannel(_remotingPort);////一到这步就报错了。!! ChannelServices.RegisterChannel(channel); RemotingConfiguration.RegisterWellKnownServiceType(typeof(SubmitTask), _remotingServiceName, WellKnownObjectMode.Singleton); SubmitTask.SubmitTaskEvent+=new SubmitTaskHandle(CmdResolve); } catch (Exception ex) { throw new Exception(ex.Message+"||"+ex.StackTrace);//(string.Format("启动remoting服务失败,{0}端口被占用!", _remotingPort)); } }