.NETGURU
can not deserilaize the remote interface returned from a Factory hosting ServicedComponent : " Insufficient state to deserialize the object."
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.component_services.

Post a new message to this list...

Jim Hsu
I use a remote factory to dynamic load the .net servicedComponent , and return as an fixed interface.

it does not work. , the error below, ,
the funny thing is that when I add reference to this .net servicedcomponent in the client, it will work, however, apparently this break the idea of "dynamic".

the same code work perfectly for a component inheritant from MarshalByRefObject in stead., so it seems the code is ok, just does not work with serviced component.

I pasted to code below: can anyone tell what is going wrong.
If I am going on the wrong direction, let me know,
I need COM+ for object pooling, application recycling, statistics ....etc.
I don't like to build thing from the scratch, the truth that MS is hold us to wait for Indigo in 2+ years, is not a good news for us building enterprise application .net application ...
sigh..., just $.02

"Event Type: Error
Event Source: Sharkgrin.tigerCon
Event Category: (78)
Event ID: 888
Date: 9/13/2004
Time: 9:25:54 PM
User: N/A
Computer: LUNAR1
Description:
con error
----------------LogPack Statck Trace -------------------
Error at offset 137 in file:line:column d:\j\depot\bluestar\integration\main\instrumentations\logpack\logpack.cs:756:6
CheethasCon3 at offset 314 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:235:5
Main at offset 13 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:41:4

System.Runtime.Serialization.SerializationException: Insufficient state to deserialize the object. More information is needed.

Server stack trace:
at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeMessageParts(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Sharkgrin.RemoteFactory.LoadAdapter(String assemblyFile, String typeName, Object[] constructArgs) in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\remotefactory.cs:line 27
at Sharkgrin.tigerCon.CheethasCon3() in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:line 226

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
"

source code

public static void conDoe4()

{

Console.WriteLine("ConDoe4() in use!");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = doeFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

setup.ApplicationName = "AdapterDoeLoader";

//AppDomain appDomain1 = "DoeLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

a1 = factory1.LoadAdapter("Doe", "Sharkgrin.Doe", null);

logger.Debug("doe loaded!");

logger.Info("Doe.SendReceive(1234abcd) = " + a1.SendReceive("1234abcd"));

}

public static void CheethasCon3()

{

logger.Debug(" CheethasCon 3 : using AppDomain RemoteLoader !");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = adapterFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

//setup.PrivateBinPath = adapterFolder;

setup.ApplicationName = "AdapterLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

try

{

a1 = factory1.LoadAdapter("cheethasJr",

"BlueStar.Integration.Adapters.CheethasJr",null);

logger.Debug( "or1 returned ");

}

catch(Exception e)

{

logger.Error("con error", e, 888);

Thread.Sleep(77000);

}

if (a1 == null)

{

logger.Error("a1 is null",888);

}

else

{

logger.Info(" as.sendReceive " + a1.SendReceive("1234abced, from remote a.."));

}

}

public class RemoteFactory : MarshalByRefObject

{

static readonly LogPack logger
LogPack.GetLogger(typeof(RemoteFactory));

private const BindingFlags bfi =

BindingFlags.Instance | BindingFlags.Public |

BindingFlags.CreateInstance ;

public IAdapter LoadAdapter( string assemblyFile,

string typeName,object[] constructArgs )

{

logger.Debug("Create() -> tassemblyFile : " + assemblyFile +

"typeName = " + typeName);

logger.Debug("AppDomain Base : " + AppDomain.CurrentDomain.BaseDirectory );

logger.Debug("Appdomain FreindlyName = " + AppDomain.CurrentDomain.FriendlyName);

logger.Info( "\tRelativeSearchPath : " + AppDomain.CurrentDomain.RelativeSearchPath);

logger.Info("\tPrivateBinPath : " + AppDomain.CurrentDomain.SetupInformation.PrivateBinPath);

logger.Debug("assembly loading ...!");

Assembly ass1 = Assembly.Load(assemblyFile);

if (ass1 == null)

{

logger.Error(" ass1 is null ", 888);

}

else

{

logger.Debug(" ass1 is not null !" );

}

object o1 = ass1.CreateInstance( typeName);

// ObjectHandle oh1 = .CreateInstanceFrom( assemblyFile,

// typeName,false, bfi, null, constructArgs,null,null,null);

//

// object o1 = oh1.Unwrap();

if (o1!= null)

{

logger.Debug("o1 is not null!");

}

else

{

logger.Error("o1 is null ", 88);

}

// MarshalByRefObject mbro1 = null;

// mbro1 = o1 as MarshalByRefObject;

// if (mbro1!= null)

// {

// logger.Debug("Mbro1 is not null!");

// }

// else

// {

// logger.Error("Mbro1 is null ", 88);

//

// }

// return RemotingServices.Marshal(mbro1);

IAdapter a1 = o1 as IAdapter;

if ( a1 == null )

{

logger.Error(" as is null !", 88);

return null;

}

else

{

logger.Debug(" o1 as a1 will be returned !");

return a1;

}

}

Reply to this message...
 
    
José Miguel Torres
Hi Jim,

Now make sure to put the assembly into GAC, tell me as it goes...
regards

--
José Miguel Torres
jtorres_diaz~~ARROBA~~terra.es
http://jmtorres.blogspot.com

"Jim Hsu" <Click here to reveal e-mail address> escribió en el mensaje news:Click here to reveal e-mail address...
I use a remote factory to dynamic load the .net servicedComponent , and return as an fixed interface.

it does not work. , the error below, ,
the funny thing is that when I add reference to this .net servicedcomponent in the client, it will work, however, apparently this break the idea of "dynamic".

the same code work perfectly for a component inheritant from MarshalByRefObject in stead., so it seems the code is ok, just does not work with serviced component.

I pasted to code below: can anyone tell what is going wrong.
If I am going on the wrong direction, let me know,
I need COM+ for object pooling, application recycling, statistics ....etc.
I don't like to build thing from the scratch, the truth that MS is hold us to wait for Indigo in 2+ years, is not a good news for us building enterprise application .net application ...
sigh..., just $.02

"Event Type: Error
Event Source: Sharkgrin.tigerCon
Event Category: (78)
Event ID: 888
Date: 9/13/2004
Time: 9:25:54 PM
User: N/A
Computer: LUNAR1
Description:
con error
----------------LogPack Statck Trace -------------------
Error at offset 137 in file:line:column d:\j\depot\bluestar\integration\main\instrumentations\logpack\logpack.cs:756:6
CheethasCon3 at offset 314 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:235:5
Main at offset 13 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:41:4

System.Runtime.Serialization.SerializationException: Insufficient state to deserialize the object. More information is needed.

Server stack trace:
at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeMessageParts(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Sharkgrin.RemoteFactory.LoadAdapter(String assemblyFile, String typeName, Object[] constructArgs) in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\remotefactory.cs:line 27
at Sharkgrin.tigerCon.CheethasCon3() in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:line 226

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
"

source code

public static void conDoe4()

{

Console.WriteLine("ConDoe4() in use!");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = doeFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

setup.ApplicationName = "AdapterDoeLoader";

//AppDomain appDomain1 = "DoeLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

a1 = factory1.LoadAdapter("Doe", "Sharkgrin.Doe", null);

logger.Debug("doe loaded!");

logger.Info("Doe.SendReceive(1234abcd) = " + a1.SendReceive("1234abcd"));

}

public static void CheethasCon3()

{

logger.Debug(" CheethasCon 3 : using AppDomain RemoteLoader !");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = adapterFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

//setup.PrivateBinPath = adapterFolder;

setup.ApplicationName = "AdapterLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

try

{

a1 = factory1.LoadAdapter("cheethasJr",

"BlueStar.Integration.Adapters.CheethasJr",null);

logger.Debug( "or1 returned ");

}

catch(Exception e)

{

logger.Error("con error", e, 888);

Thread.Sleep(77000);

}

if (a1 == null)

{

logger.Error("a1 is null",888);

}

else

{

logger.Info(" as.sendReceive " + a1.SendReceive("1234abced, from remote a.."));

}

}

public class RemoteFactory : MarshalByRefObject

{

static readonly LogPack logger
LogPack.GetLogger(typeof(RemoteFactory));

private const BindingFlags bfi =

BindingFlags.Instance | BindingFlags.Public |

BindingFlags.CreateInstance ;

public IAdapter LoadAdapter( string assemblyFile,

string typeName,object[] constructArgs )

{

logger.Debug("Create() -> tassemblyFile : " + assemblyFile +

"typeName = " + typeName);

logger.Debug("AppDomain Base : " + AppDomain.CurrentDomain.BaseDirectory );

logger.Debug("Appdomain FreindlyName = " + AppDomain.CurrentDomain.FriendlyName);

logger.Info( "\tRelativeSearchPath : " + AppDomain.CurrentDomain.RelativeSearchPath);

logger.Info("\tPrivateBinPath : " + AppDomain.CurrentDomain.SetupInformation.PrivateBinPath);

logger.Debug("assembly loading ...!");

Assembly ass1 = Assembly.Load(assemblyFile);

if (ass1 == null)

{

logger.Error(" ass1 is null ", 888);

}

else

{

logger.Debug(" ass1 is not null !" );

}

object o1 = ass1.CreateInstance( typeName);

// ObjectHandle oh1 = .CreateInstanceFrom( assemblyFile,

// typeName,false, bfi, null, constructArgs,null,null,null);

//

// object o1 = oh1.Unwrap();

if (o1!= null)

{

logger.Debug("o1 is not null!");

}

else

{

logger.Error("o1 is null ", 88);

}

// MarshalByRefObject mbro1 = null;

// mbro1 = o1 as MarshalByRefObject;

// if (mbro1!= null)

// {

// logger.Debug("Mbro1 is not null!");

// }

// else

// {

// logger.Error("Mbro1 is null ", 88);

//

// }

// return RemotingServices.Marshal(mbro1);

IAdapter a1 = o1 as IAdapter;

if ( a1 == null )

{

logger.Error(" as is null !", 88);

return null;

}

else

{

logger.Debug(" o1 as a1 will be returned !");

return a1;

}

}

Reply to this message...
 
    
Jim Hsu
tried, not working :-)
can load assembly, but can't not simply return that interface. :-)
working on other solution now.

"José Miguel Torres" <jtorres_diaz~~ARROBA~~terra.es> wrote in message news:%Click here to reveal e-mail address...
Hi Jim,

Now make sure to put the assembly into GAC, tell me as it goes...
regards

--
José Miguel Torres
jtorres_diaz~~ARROBA~~terra.es
http://jmtorres.blogspot.com

"Jim Hsu" <Click here to reveal e-mail address> escribió en el mensaje news:Click here to reveal e-mail address...
I use a remote factory to dynamic load the .net servicedComponent , and return as an fixed interface.

it does not work. , the error below, ,
the funny thing is that when I add reference to this .net servicedcomponent in the client, it will work, however, apparently this break the idea of "dynamic".

the same code work perfectly for a component inheritant from MarshalByRefObject in stead., so it seems the code is ok, just does not work with serviced component.

I pasted to code below: can anyone tell what is going wrong.
If I am going on the wrong direction, let me know,
I need COM+ for object pooling, application recycling, statistics ....etc.
I don't like to build thing from the scratch, the truth that MS is hold us to wait for Indigo in 2+ years, is not a good news for us building enterprise application .net application ...
sigh..., just $.02

"Event Type: Error
Event Source: Sharkgrin.tigerCon
Event Category: (78)
Event ID: 888
Date: 9/13/2004
Time: 9:25:54 PM
User: N/A
Computer: LUNAR1
Description:
con error
----------------LogPack Statck Trace -------------------
Error at offset 137 in file:line:column d:\j\depot\bluestar\integration\main\instrumentations\logpack\logpack.cs:756:6
CheethasCon3 at offset 314 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:235:5
Main at offset 13 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:41:4

System.Runtime.Serialization.SerializationException: Insufficient state to deserialize the object. More information is needed.

Server stack trace:
at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeMessageParts(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Sharkgrin.RemoteFactory.LoadAdapter(String assemblyFile, String typeName, Object[] constructArgs) in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\remotefactory.cs:line 27
at Sharkgrin.tigerCon.CheethasCon3() in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:line 226

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
"

source code

public static void conDoe4()

{

Console.WriteLine("ConDoe4() in use!");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = doeFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

setup.ApplicationName = "AdapterDoeLoader";

//AppDomain appDomain1 = "DoeLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

a1 = factory1.LoadAdapter("Doe", "Sharkgrin.Doe", null);

logger.Debug("doe loaded!");

logger.Info("Doe.SendReceive(1234abcd) = " + a1.SendReceive("1234abcd"));

}

public static void CheethasCon3()

{

logger.Debug(" CheethasCon 3 : using AppDomain RemoteLoader !");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = adapterFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

//setup.PrivateBinPath = adapterFolder;

setup.ApplicationName = "AdapterLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

try

{

a1 = factory1.LoadAdapter("cheethasJr",

"BlueStar.Integration.Adapters.CheethasJr",null);

logger.Debug( "or1 returned ");

}

catch(Exception e)

{

logger.Error("con error", e, 888);

Thread.Sleep(77000);

}

if (a1 == null)

{

logger.Error("a1 is null",888);

}

else

{

logger.Info(" as.sendReceive " + a1.SendReceive("1234abced, from remote a.."));

}

}

public class RemoteFactory : MarshalByRefObject

{

static readonly LogPack logger
LogPack.GetLogger(typeof(RemoteFactory));

private const BindingFlags bfi =

BindingFlags.Instance | BindingFlags.Public |

BindingFlags.CreateInstance ;

public IAdapter LoadAdapter( string assemblyFile,

string typeName,object[] constructArgs )

{

logger.Debug("Create() -> tassemblyFile : " + assemblyFile +

"typeName = " + typeName);

logger.Debug("AppDomain Base : " + AppDomain.CurrentDomain.BaseDirectory );

logger.Debug("Appdomain FreindlyName = " + AppDomain.CurrentDomain.FriendlyName);

logger.Info( "\tRelativeSearchPath : " + AppDomain.CurrentDomain.RelativeSearchPath);

logger.Info("\tPrivateBinPath : " + AppDomain.CurrentDomain.SetupInformation.PrivateBinPath);

logger.Debug("assembly loading ...!");

Assembly ass1 = Assembly.Load(assemblyFile);

if (ass1 == null)

{

logger.Error(" ass1 is null ", 888);

}

else

{

logger.Debug(" ass1 is not null !" );

}

object o1 = ass1.CreateInstance( typeName);

// ObjectHandle oh1 = .CreateInstanceFrom( assemblyFile,

// typeName,false, bfi, null, constructArgs,null,null,null);

//

// object o1 = oh1.Unwrap();

if (o1!= null)

{

logger.Debug("o1 is not null!");

}

else

{

logger.Error("o1 is null ", 88);

}

// MarshalByRefObject mbro1 = null;

// mbro1 = o1 as MarshalByRefObject;

// if (mbro1!= null)

// {

// logger.Debug("Mbro1 is not null!");

// }

// else

// {

// logger.Error("Mbro1 is null ", 88);

//

// }

// return RemotingServices.Marshal(mbro1);

IAdapter a1 = o1 as IAdapter;

if ( a1 == null )

{

logger.Error(" as is null !", 88);

return null;

}

else

{

logger.Debug(" o1 as a1 will be returned !");

return a1;

}

}

Reply to this message...
 
    
José Miguel Torres
Hi Jim, have you registered your COM+ application as Library o Server application?
regards

--
José Miguel Torres
jtorres_diaz~~ARROBA~~terra.es
http://jmtorres.blogspot.com
"Jim Hsu" <Click here to reveal e-mail address> escribió en el mensaje news:Click here to reveal e-mail address...
I use a remote factory to dynamic load the .net servicedComponent , and return as an fixed interface.

it does not work. , the error below, ,
the funny thing is that when I add reference to this .net servicedcomponent in the client, it will work, however, apparently this break the idea of "dynamic".

the same code work perfectly for a component inheritant from MarshalByRefObject in stead., so it seems the code is ok, just does not work with serviced component.

I pasted to code below: can anyone tell what is going wrong.
If I am going on the wrong direction, let me know,
I need COM+ for object pooling, application recycling, statistics ....etc.
I don't like to build thing from the scratch, the truth that MS is hold us to wait for Indigo in 2+ years, is not a good news for us building enterprise application .net application ...
sigh..., just $.02

"Event Type: Error
Event Source: Sharkgrin.tigerCon
Event Category: (78)
Event ID: 888
Date: 9/13/2004
Time: 9:25:54 PM
User: N/A
Computer: LUNAR1
Description:
con error
----------------LogPack Statck Trace -------------------
Error at offset 137 in file:line:column d:\j\depot\bluestar\integration\main\instrumentations\logpack\logpack.cs:756:6
CheethasCon3 at offset 314 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:235:5
Main at offset 13 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:41:4

System.Runtime.Serialization.SerializationException: Insufficient state to deserialize the object. More information is needed.

Server stack trace:
at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeMessageParts(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Sharkgrin.RemoteFactory.LoadAdapter(String assemblyFile, String typeName, Object[] constructArgs) in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\remotefactory.cs:line 27
at Sharkgrin.tigerCon.CheethasCon3() in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:line 226

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
"

source code

public static void conDoe4()

{

Console.WriteLine("ConDoe4() in use!");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = doeFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

setup.ApplicationName = "AdapterDoeLoader";

//AppDomain appDomain1 = "DoeLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

a1 = factory1.LoadAdapter("Doe", "Sharkgrin.Doe", null);

logger.Debug("doe loaded!");

logger.Info("Doe.SendReceive(1234abcd) = " + a1.SendReceive("1234abcd"));

}

public static void CheethasCon3()

{

logger.Debug(" CheethasCon 3 : using AppDomain RemoteLoader !");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = adapterFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

//setup.PrivateBinPath = adapterFolder;

setup.ApplicationName = "AdapterLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

try

{

a1 = factory1.LoadAdapter("cheethasJr",

"BlueStar.Integration.Adapters.CheethasJr",null);

logger.Debug( "or1 returned ");

}

catch(Exception e)

{

logger.Error("con error", e, 888);

Thread.Sleep(77000);

}

if (a1 == null)

{

logger.Error("a1 is null",888);

}

else

{

logger.Info(" as.sendReceive " + a1.SendReceive("1234abced, from remote a.."));

}

}

public class RemoteFactory : MarshalByRefObject

{

static readonly LogPack logger
LogPack.GetLogger(typeof(RemoteFactory));

private const BindingFlags bfi =

BindingFlags.Instance | BindingFlags.Public |

BindingFlags.CreateInstance ;

public IAdapter LoadAdapter( string assemblyFile,

string typeName,object[] constructArgs )

{

logger.Debug("Create() -> tassemblyFile : " + assemblyFile +

"typeName = " + typeName);

logger.Debug("AppDomain Base : " + AppDomain.CurrentDomain.BaseDirectory );

logger.Debug("Appdomain FreindlyName = " + AppDomain.CurrentDomain.FriendlyName);

logger.Info( "\tRelativeSearchPath : " + AppDomain.CurrentDomain.RelativeSearchPath);

logger.Info("\tPrivateBinPath : " + AppDomain.CurrentDomain.SetupInformation.PrivateBinPath);

logger.Debug("assembly loading ...!");

Assembly ass1 = Assembly.Load(assemblyFile);

if (ass1 == null)

{

logger.Error(" ass1 is null ", 888);

}

else

{

logger.Debug(" ass1 is not null !" );

}

object o1 = ass1.CreateInstance( typeName);

// ObjectHandle oh1 = .CreateInstanceFrom( assemblyFile,

// typeName,false, bfi, null, constructArgs,null,null,null);

//

// object o1 = oh1.Unwrap();

if (o1!= null)

{

logger.Debug("o1 is not null!");

}

else

{

logger.Error("o1 is null ", 88);

}

// MarshalByRefObject mbro1 = null;

// mbro1 = o1 as MarshalByRefObject;

// if (mbro1!= null)

// {

// logger.Debug("Mbro1 is not null!");

// }

// else

// {

// logger.Error("Mbro1 is null ", 88);

//

// }

// return RemotingServices.Marshal(mbro1);

IAdapter a1 = o1 as IAdapter;

if ( a1 == null )

{

logger.Error(" as is null !", 88);

return null;

}

else

{

logger.Debug(" o1 as a1 will be returned !");

return a1;

}

}

Reply to this message...
 
    
Jim Hsu
Jose:
yes, I have,
both server and library will not work
in fact, the loader can load the .net assembly w/o issues,
the problem is when the remote loader return the instanced casted to interface ( IAdapter in my case ).
in the default domain, there is an error stating that "System.Runtime.Serialization.SerializationException: Insufficient state to deserialize the object. More information is needed."
in the line :

"
a1 = factory1.LoadAdapter("cheethasJr",

"BlueStar.Integration.Adapters.CheethasJr",null);

"

and the interesting things is when I add reference to the target assembly ( which should be dynamically loaded ). the error is gone.
however, it makes not sense to reference the assembly which are to be loaded in run time.

this issue does not repro if the to be loaded type is marshalByRefObject instead of servicedComponent.

"José Miguel Torres" <jtorres_diaz~~ARROBA~~terra.es> wrote in message news:ObDV%Click here to reveal e-mail address...
Hi Jim, have you registered your COM+ application as Library o Server application?
regards

--
José Miguel Torres
jtorres_diaz~~ARROBA~~terra.es
http://jmtorres.blogspot.com
"Jim Hsu" <Click here to reveal e-mail address> escribió en el mensaje news:Click here to reveal e-mail address...
I use a remote factory to dynamic load the .net servicedComponent , and return as an fixed interface.

it does not work. , the error below, ,
the funny thing is that when I add reference to this .net servicedcomponent in the client, it will work, however, apparently this break the idea of "dynamic".

the same code work perfectly for a component inheritant from MarshalByRefObject in stead., so it seems the code is ok, just does not work with serviced component.

I pasted to code below: can anyone tell what is going wrong.
If I am going on the wrong direction, let me know,
I need COM+ for object pooling, application recycling, statistics ....etc.
I don't like to build thing from the scratch, the truth that MS is hold us to wait for Indigo in 2+ years, is not a good news for us building enterprise application .net application ...
sigh..., just $.02

"Event Type: Error
Event Source: Sharkgrin.tigerCon
Event Category: (78)
Event ID: 888
Date: 9/13/2004
Time: 9:25:54 PM
User: N/A
Computer: LUNAR1
Description:
con error
----------------LogPack Statck Trace -------------------
Error at offset 137 in file:line:column d:\j\depot\bluestar\integration\main\instrumentations\logpack\logpack.cs:756:6
CheethasCon3 at offset 314 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:235:5
Main at offset 13 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:41:4

System.Runtime.Serialization.SerializationException: Insufficient state to deserialize the object. More information is needed.

Server stack trace:
at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeMessageParts(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Sharkgrin.RemoteFactory.LoadAdapter(String assemblyFile, String typeName, Object[] constructArgs) in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\remotefactory.cs:line 27
at Sharkgrin.tigerCon.CheethasCon3() in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:line 226

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
"

source code

public static void conDoe4()

{

Console.WriteLine("ConDoe4() in use!");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = doeFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

setup.ApplicationName = "AdapterDoeLoader";

//AppDomain appDomain1 = "DoeLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

a1 = factory1.LoadAdapter("Doe", "Sharkgrin.Doe", null);

logger.Debug("doe loaded!");

logger.Info("Doe.SendReceive(1234abcd) = " + a1.SendReceive("1234abcd"));

}

public static void CheethasCon3()

{

logger.Debug(" CheethasCon 3 : using AppDomain RemoteLoader !");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = adapterFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

//setup.PrivateBinPath = adapterFolder;

setup.ApplicationName = "AdapterLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

try

{

a1 = factory1.LoadAdapter("cheethasJr",

"BlueStar.Integration.Adapters.CheethasJr",null);

logger.Debug( "or1 returned ");

}

catch(Exception e)

{

logger.Error("con error", e, 888);

Thread.Sleep(77000);

}

if (a1 == null)

{

logger.Error("a1 is null",888);

}

else

{

logger.Info(" as.sendReceive " + a1.SendReceive("1234abced, from remote a.."));

}

}

public class RemoteFactory : MarshalByRefObject

{

static readonly LogPack logger
LogPack.GetLogger(typeof(RemoteFactory));

private const BindingFlags bfi =

BindingFlags.Instance | BindingFlags.Public |

BindingFlags.CreateInstance ;

public IAdapter LoadAdapter( string assemblyFile,

string typeName,object[] constructArgs )

{

logger.Debug("Create() -> tassemblyFile : " + assemblyFile +

"typeName = " + typeName);

logger.Debug("AppDomain Base : " + AppDomain.CurrentDomain.BaseDirectory );

logger.Debug("Appdomain FreindlyName = " + AppDomain.CurrentDomain.FriendlyName);

logger.Info( "\tRelativeSearchPath : " + AppDomain.CurrentDomain.RelativeSearchPath);

logger.Info("\tPrivateBinPath : " + AppDomain.CurrentDomain.SetupInformation.PrivateBinPath);

logger.Debug("assembly loading ...!");

Assembly ass1 = Assembly.Load(assemblyFile);

if (ass1 == null)

{

logger.Error(" ass1 is null ", 888);

}

else

{

logger.Debug(" ass1 is not null !" );

}

object o1 = ass1.CreateInstance( typeName);

// ObjectHandle oh1 = .CreateInstanceFrom( assemblyFile,

// typeName,false, bfi, null, constructArgs,null,null,null);

//

// object o1 = oh1.Unwrap();

if (o1!= null)

{

logger.Debug("o1 is not null!");

}

else

{

logger.Error("o1 is null ", 88);

}

// MarshalByRefObject mbro1 = null;

// mbro1 = o1 as MarshalByRefObject;

// if (mbro1!= null)

// {

// logger.Debug("Mbro1 is not null!");

// }

// else

// {

// logger.Error("Mbro1 is null ", 88);

//

// }

// return RemotingServices.Marshal(mbro1);

IAdapter a1 = o1 as IAdapter;

if ( a1 == null )

{

logger.Error(" as is null !", 88);

return null;

}

else

{

logger.Debug(" o1 as a1 will be returned !");

return a1;

}

}

Reply to this message...
 
    
Jim Hsu
I am in the dead water now,
I tried to work around this using AssemblyLoadFrom,
but I 've no activator to activate and process the return ObjectHandle from the ServicedComponent....

can anyone shed some lights on this?

otherwise, I have to build a poolman's COM+ using C#....

sigh...

"Jim Hsu" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address...
Jose:
yes, I have,
both server and library will not work
in fact, the loader can load the .net assembly w/o issues,
the problem is when the remote loader return the instanced casted to interface ( IAdapter in my case ).
in the default domain, there is an error stating that "System.Runtime.Serialization.SerializationException: Insufficient state to deserialize the object. More information is needed."
in the line :

"
a1 = factory1.LoadAdapter("cheethasJr",

"BlueStar.Integration.Adapters.CheethasJr",null);

"

and the interesting things is when I add reference to the target assembly ( which should be dynamically loaded ). the error is gone.
however, it makes not sense to reference the assembly which are to be loaded in run time.

this issue does not repro if the to be loaded type is marshalByRefObject instead of servicedComponent.

"José Miguel Torres" <jtorres_diaz~~ARROBA~~terra.es> wrote in message news:ObDV%Click here to reveal e-mail address...
Hi Jim, have you registered your COM+ application as Library o Server application?
regards

--
José Miguel Torres
jtorres_diaz~~ARROBA~~terra.es
http://jmtorres.blogspot.com
"Jim Hsu" <Click here to reveal e-mail address> escribió en el mensaje news:Click here to reveal e-mail address...
I use a remote factory to dynamic load the .net servicedComponent , and return as an fixed interface.

it does not work. , the error below, ,
the funny thing is that when I add reference to this .net servicedcomponent in the client, it will work, however, apparently this break the idea of "dynamic".

the same code work perfectly for a component inheritant from MarshalByRefObject in stead., so it seems the code is ok, just does not work with serviced component.

I pasted to code below: can anyone tell what is going wrong.
If I am going on the wrong direction, let me know,
I need COM+ for object pooling, application recycling, statistics ....etc.
I don't like to build thing from the scratch, the truth that MS is hold us to wait for Indigo in 2+ years, is not a good news for us building enterprise application .net application ...
sigh..., just $.02

"Event Type: Error
Event Source: Sharkgrin.tigerCon
Event Category: (78)
Event ID: 888
Date: 9/13/2004
Time: 9:25:54 PM
User: N/A
Computer: LUNAR1
Description:
con error
----------------LogPack Statck Trace -------------------
Error at offset 137 in file:line:column d:\j\depot\bluestar\integration\main\instrumentations\logpack\logpack.cs:756:6
CheethasCon3 at offset 314 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:235:5
Main at offset 13 in file:line:column d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:41:4

System.Runtime.Serialization.SerializationException: Insufficient state to deserialize the object. More information is needed.

Server stack trace:
at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeMessageParts(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Sharkgrin.RemoteFactory.LoadAdapter(String assemblyFile, String typeName, Object[] constructArgs) in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\remotefactory.cs:line 27
at Sharkgrin.tigerCon.CheethasCon3() in d:\j\depot\bluestar\integration\main\core\msghandler\tiger\tigercon2\tigercon2.cs:line 226

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
"

source code

public static void conDoe4()

{

Console.WriteLine("ConDoe4() in use!");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = doeFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

setup.ApplicationName = "AdapterDoeLoader";

//AppDomain appDomain1 = "DoeLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

a1 = factory1.LoadAdapter("Doe", "Sharkgrin.Doe", null);

logger.Debug("doe loaded!");

logger.Info("Doe.SendReceive(1234abcd) = " + a1.SendReceive("1234abcd"));

}

public static void CheethasCon3()

{

logger.Debug(" CheethasCon 3 : using AppDomain RemoteLoader !");

AppDomainSetup setup = new AppDomainSetup();

setup.ApplicationBase = adapterFolder;

setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;

//setup.PrivateBinPath = adapterFolder;

setup.ApplicationName = "AdapterLoader";

AppDomain appDomain1 = AppDomain.CreateDomain("RemoteLoaderDomain",

null, setup);

RemoteFactory factory1 = ( RemoteFactory )

appDomain1.CreateInstanceFromAndUnwrap("tigerCon2.exe",

"Sharkgrin.RemoteFactory");

IAdapter a1 = null;

try

{

a1 = factory1.LoadAdapter("cheethasJr",

"BlueStar.Integration.Adapters.CheethasJr",null);

logger.Debug( "or1 returned ");

}

catch(Exception e)

{

logger.Error("con error", e, 888);

Thread.Sleep(77000);

}

if (a1 == null)

{

logger.Error("a1 is null",888);

}

else

{

logger.Info(" as.sendReceive " + a1.SendReceive("1234abced, from remote a.."));

}

}

public class RemoteFactory : MarshalByRefObject

{

static readonly LogPack logger
LogPack.GetLogger(typeof(RemoteFactory));

private const BindingFlags bfi =

BindingFlags.Instance | BindingFlags.Public |

BindingFlags.CreateInstance ;

public IAdapter LoadAdapter( string assemblyFile,

string typeName,object[] constructArgs )

{

logger.Debug("Create() -> tassemblyFile : " + assemblyFile +

"typeName = " + typeName);

logger.Debug("AppDomain Base : " + AppDomain.CurrentDomain.BaseDirectory );

logger.Debug("Appdomain FreindlyName = " + AppDomain.CurrentDomain.FriendlyName);

logger.Info( "\tRelativeSearchPath : " + AppDomain.CurrentDomain.RelativeSearchPath);

logger.Info("\tPrivateBinPath : " + AppDomain.CurrentDomain.SetupInformation.PrivateBinPath);

logger.Debug("assembly loading ...!");

Assembly ass1 = Assembly.Load(assemblyFile);

if (ass1 == null)

{

logger.Error(" ass1 is null ", 888);

}

else

{

logger.Debug(" ass1 is not null !" );

}

object o1 = ass1.CreateInstance( typeName);

// ObjectHandle oh1 = .CreateInstanceFrom( assemblyFile,

// typeName,false, bfi, null, constructArgs,null,null,null);

//

// object o1 = oh1.Unwrap();

if (o1!= null)

{

logger.Debug("o1 is not null!");

}

else

{

logger.Error("o1 is null ", 88);

}

// MarshalByRefObject mbro1 = null;

// mbro1 = o1 as MarshalByRefObject;

// if (mbro1!= null)

// {

// logger.Debug("Mbro1 is not null!");

// }

// else

// {

// logger.Error("Mbro1 is null ", 88);

//

// }

// return RemotingServices.Marshal(mbro1);

IAdapter a1 = o1 as IAdapter;

if ( a1 == null )

{

logger.Error(" as is null !", 88);

return null;

}

else

{

logger.Debug(" o1 as a1 will be returned !");

return a1;

}

}

Reply to this message...
 
 
System.AppDomain
System.AppDomainSetup
System.Console
System.EnterpriseServices.ServicedComponent
System.IO.MemoryStream
System.MarshalByRefObject
System.Reflection.Assembly
System.Reflection.BindingFlags
System.Runtime.Remoting.Messaging.HeaderHandler
System.Runtime.Remoting.Messaging.IMessage
System.Runtime.Remoting.Messaging.IMethodCallMessage
System.Runtime.Remoting.ObjectHandle
System.Runtime.Remoting.Proxies.RealProxy
System.Runtime.Remoting.RemotingServices
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
System.Runtime.Serialization.ObjectManager
System.Runtime.Serialization.SerializationException
System.Runtime.Serialization.StreamingContext
System.Threading.Thread




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification