public override void Publish() { // Create the QueryHandler IQueryHandler queryHandler = new SqlQueryHandler(dataContext); #region Start the WCF server ServerQueryWcfHandler wcfServer = new ServerQueryWcfHandler(queryHandler); NetTcpBinding netTcpBinding = ServiceHelper.GetNetTcpBinding(); string serviceUri = ServiceHelper.GetServiceUri(null, null, Artefacts.ServiceConstants.SqlServiceName); wcfServer.Start(netTcpBinding, serviceUri); #endregion #region Start the remoting server ServerQueryRemotingHandlerSql remotingServer = new ServerQueryRemotingHandlerSql(queryHandler); // Register default channel for remote access Hashtable properties = new Hashtable(); properties["name"] = Artefacts.ServiceConstants.SqlServiceName; properties["port"] = Artefacts.ServiceConstants.SqlPort; IChannel currentChannel = RemotingConstants.GetDefaultChannel(properties); ChannelServices.RegisterChannel(currentChannel, false); remotingServer.Start(Artefacts.ServiceConstants.SqlServiceName, false); #endregion }