Hi!
I have my own class "mtxApplicationException"
bulid like shown in "MS Error Handling Block".
When i use it in windows application everything works fine.
But when I throw this exception in EnterpriseServices application,
and try to handle it in client application,
it comes as base exception type (ApplicationException)
and loose all additional information i provide...
What do I wrong?
Pawel
Short piece of code
[Serializable]
public class mtxApplicationException : ApplicationException
public mtxApplicationException(string message, string par_source_code,
Exception inner) : base(message, inner)
{
InitializeProperties();
m_source_code = par_source_code;
}
protected mtxApplicationException(SerializationInfo info,
StreamingContext context) : base(info, context)
{
m_machine_name = info.GetString("m_machine_name");
m_app_domain = info.GetString("m_app_domain");
m_source_code = info.GetString("m_source_code");
}
[SecurityPermission(SecurityAction.Demand, SerializationFormatter =
true)]
public override void GetObjectData( SerializationInfo info,
StreamingContext context )
{
info.AddValue("m_machine_name", m_machine_name, typeof(string));
info.AddValue("m_app_domain", m_app_domain, typeof(string));
info.AddValue("m_source_code", m_source_code, typeof(string));
base.GetObjectData(info,context);
}
in COM+ component:
try
{
//operations
}
catch (Exception ex)
{
throw new mtxApplicationException ("Error during list read", "some info",
ex);
}