Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / November 2005

Tip: Looking for answers? Try searching our database.

Err.Raise in ES component

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ramesh - 02 Nov 2005 21:46 GMT
I have a EnterpriseServices (ES) component with custom Err.Raise statement
Err.Raise(vbObjectError + 9100). When the client tries to trap the error, the
err number that is returned from ES component is 5, instead of -2147212404.

Kinda weird.

Any help is greatly appreciated?
Morten Abrahamsen - 06 Nov 2005 21:16 GMT
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?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.