I'm not certain about your particular case, but I assume you are hosting
your ES component in a Server activated "ES application".
ES has two modes for communication that among other things will affect
how exceptions are treated. Mode 1 is COM Interop with simple
(blittable) types, and mode 2 is full .Net serialization.
Depending on which mode is chosen (this decision is an internal working
of ES) you will see two different error strategies. If it is in "COM
Interop" mode it will either give you one of the already known .Net
exceptions, or the generic COMException.
If it is in .Net serializer mode, it will give you the custom exceptions
you are using.
Anyways, try adding the plain object type to your method signature and
see if it works now. Adding a non-blittable type like "object" will
force it into .Net Serializer mode, and you should get the expected
exception behavior.
Unfortunately there is no way to force ".Net Serializer" and full
exception fidelity mode without affacting the method signature or some
security settings.
Hope this helps,
Morty
---- Added Object Type sample ----
public void Test(object myObject, string var, string var2)
{
}
---
> I have a EnterpriseServices (ES) component with custom Err.Raise statement
> Err.Raise(vbObjectError + 9100). When the client tries to trap the error, the
[quoted text clipped - 3 lines]
>
> Any help is greatly appreciated?
Ramesh - 07 Nov 2005 13:41 GMT
Thanks Morty,
And whatever you mentioned is true.
There is a marshalling problem in custom Err#, and Microsoft has provided me
a workaround of throwing COM exception like this:
Throw New COMException(Err.Description, vbObjectError + 9100)
And it works.
Thanks again,
> I'm not certain about your particular case, but I assume you are hosting
> your ES component in a Server activated "ES application".
[quoted text clipped - 37 lines]
> >
> > Any help is greatly appreciated?