GISServerConnection conn = null; IServerObjectAdmin7 soa = null conn = new GISServerConnection(); conn.Connect(server); soa = (IServerObjectAdmin7)conn.ServerObjectAdmin; IEnumServerObjectConfiguration enumconfig = soa.GetConfigurations(); IServerObjectConfiguration config = enumconfig.Next(); config.WaitTimeout = 600; while (config != null) { //Check to see service is started and not the service with the LIS_Print SOE capability IServerObjectConfigurationStatus configStatus = soa.GetConfigurationStatus(config.Name, config.TypeName); if (config.Name != serverObjectHelper.ServerObject.ConfigurationName && configStatus.Status == esriConfigurationStatus.esriCSStarted) { if (config.TypeName == "MapServer") { IServerObjectManager4 som = (IServerObjectManager4)conn.ServerObjectManager; IServerContext serverContext = som.CreateServerContext(config.Name, "MapServer"); IServerObject serverObject = serverContext.ServerObject; IMapServer3 mapServer = (IMapServer3)serverObject; GetMapLayerSettings(mapServer, config.Name); serverContext.ReleaseContext(); } } config = enumconfig.Next(); }
At 10.1, you can no longer use ArcObjects remotely (via DCOM); this way of interacting with ArcGIS for Server is no longer supported. If you are using GISServerConnection in the Server library or AGSServerConnection in the GISClient library in your code, these need to be removed if you are working with ArcGIS 10.1 for Server
see GISClient: ArcObjects Help for .NET developers