poloboy13

IGISServerConnection2

Discussion created by poloboy13 on Nov 7, 2011
Does anyone have sample code on using  IGISServerConnection2  ? connection.Connect2(userInfo,server);

The code I have throws AccessViolationException {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}   when initiation of serverObjectManager get executed.


          //Bind to product runtime
            ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
           
            String userName = @"domain\userid";
            String roles = "agsadmin";
            String userInfo = userName + ";" + roles;
            String server = "servername";

            //Init Connection
            IGISServerConnection2 connection = new GISServerConnectionClass();
            connection.Connect2(userInfo,server);

            IServerObjectManager serverObjectManager = connection.ServerObjectManager;

Thanks!

Outcomes