By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,886 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,886 IT Pros & Developers. It's quick & easy.

Creating a thread in same app domain

P: 3
Hi,

My scenario is as follows:

I have an application, in which in one component, I am calling a method in a different thread. Please note that this method will load a dynamic assembly.

Now in case of multi-user environment, am getting following exception:


################################################## ###############
Exception: System.Runtime.Serialization.SerializationExceptio n



Message: Type 'ABC.Framework.XY.ServiceHelper.ServiceLogicExcept ion' in Assembly 'ABC.Framework.XY, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.



StackTrace: at System.Runtime.Serialization.Formatters.Binary.Wri teObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)

at System.Runtime.Serialization.Formatters.Binary.Wri teObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)

at System.Runtime.Serialization.Formatters.Binary.Obj ectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)

at System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)

at System.Runtime.Remoting.Channels.CrossAppDomainSer ializer.SerializeObject(Object obj, MemoryStream stm)

at System.AppDomain.Serialize(Object o)

at System.AppDomain.MarshalObject(Object o)

################################################## #################


Now it can be possibly due to the thread crossing the app domain boundary, throwing an exception which the other app domain then tries to serialize and since it is not marked as Serilizable throws the above exception.

Can this be the case ?

In this regards,

Is it possible to confine a new thread to the same app domain as the calling thread ?
Jan 30 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.