/// <summary> /// This method is used to get the remoting instance(transparent proxy). /// </summary> /// <typeparam name="T">Server Type.</typeparam> /// <param name="serverConfig">Instance of Config.</param> /// <returns>JobInterface</returns> public static T GetInterface<T>(ServerConfig serverConfig) { T instance = default(T);//EHN_DEC_09 if (serverConfig != null) { try { string url = String.Format("tcp://{0}:{1}/{2}", serverConfig.IPAddress, serverConfig.Port, serverConfig.URI); Log(LogMessageType.Debug, " GetInterface", "GetObject started"); instance = (T)Activator.GetObject(typeof(T), url); Log(LogMessageType.Debug, " GetInterface", "GetObject completed"); MarshalByRefObject obj = instance as MarshalByRefObject; Log(LogMessageType.Debug, " GetInterface", "GetLifetimeService started"); Object lifeTimeObject = obj.GetLifetimeService();//EHN_DEC_09 Log(LogMessageType.Debug, " GetInterface", "GetLifetimeService completed"); } //EHN_DEC_09 //.GetLifeTimeService call is added to check whether the remoting proxy //object is valid or not. If the call throws SocketException means the proxy is //pointed to invalid remoting objects. catch (SocketException ex) { Log(LogMessageType.Error, " GetInterfaceByServerConfig", ex.ToString()); //EHN_DEC_09 instance = default(T); } catch (Exception ex) { Log(LogMessageType.Error, "GetInterfaceByServerConfig", ex.ToString()); } } return instance; } in the above code GetLifetimeService takes 1 sec to return for the first time call in vs2010 build but in 2012 it is reduced. Can anyone please help me to say why this occurs and way
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)