473,396 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Cusom exceptions and COM+

I am having problems with custom exceptions in COM+, I have read the article
in MSDN (march 2004) and implemented the correct features....

The custom exception class derives of ApplicationException and also has the
[Serializeable] attribute and has a
Serialization constructor and overriden implementation of GetObjectData....

[Serializable]
public class BaseException : System.ApplicationException,
ISerializable......
The COM+ component is used in an object pool and has the following
attrbitues

[Transaction(TransactionOption.Required,
Isolation=TransactionIsolationLevel.Serializable, Timeout=60)]
[ObjectPooling(Enabled=true, MinPoolSize=2, MaxPoolSize=20,
CreationTimeout=30)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[EventTrackingEnabled (true)]
public class XXXX : ServicedComponent, IXXXX.....

Where IXXXX is the public interface.

Can anyone tell me why I am still only get System.Exception on the client
side of the COM+ boundary and not my custom exception

Cheers in advance

Ollie
Nov 16 '05 #1
3 1817
Ollie,

Custom exceptions being thrown from a serviced component are an ugly
thing. Check out the article in MSDN titled "Throwing Custom Exception
Types from a Managed COM+ Server Application", located at (watch for line
wrap):

http://msdn.microsoft.com/msdnmag/is...M/default.aspx

It will explain the issues involved.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie" <ol**********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am having problems with custom exceptions in COM+, I have read the article in MSDN (march 2004) and implemented the correct features....

The custom exception class derives of ApplicationException and also has the [Serializeable] attribute and has a
Serialization constructor and overriden implementation of GetObjectData....
[Serializable]
public class BaseException : System.ApplicationException,
ISerializable......
The COM+ component is used in an object pool and has the following
attrbitues

[Transaction(TransactionOption.Required,
Isolation=TransactionIsolationLevel.Serializable, Timeout=60)]
[ObjectPooling(Enabled=true, MinPoolSize=2, MaxPoolSize=20,
CreationTimeout=30)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[EventTrackingEnabled (true)]
public class XXXX : ServicedComponent, IXXXX.....

Where IXXXX is the public interface.

Can anyone tell me why I am still only get System.Exception on the client
side of the COM+ boundary and not my custom exception

Cheers in advance

Ollie

Nov 16 '05 #2
Cheers for the reply Nick, I have re-read the article and now see my
mistake, but from your comment do you think passing custom exceptions from
serviced components should be discouraged?

Cheers

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:Oy**************@TK2MSFTNGP10.phx.gbl...
Ollie,

Custom exceptions being thrown from a serviced component are an ugly
thing. Check out the article in MSDN titled "Throwing Custom Exception
Types from a Managed COM+ Server Application", located at (watch for line
wrap):

http://msdn.microsoft.com/msdnmag/is...M/default.aspx
It will explain the issues involved.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie" <ol**********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am having problems with custom exceptions in COM+, I have read the

article
in MSDN (march 2004) and implemented the correct features....

The custom exception class derives of ApplicationException and also has

the
[Serializeable] attribute and has a
Serialization constructor and overriden implementation of

GetObjectData....

[Serializable]
public class BaseException : System.ApplicationException,
ISerializable......
The COM+ component is used in an object pool and has the following
attrbitues

[Transaction(TransactionOption.Required,
Isolation=TransactionIsolationLevel.Serializable, Timeout=60)]
[ObjectPooling(Enabled=true, MinPoolSize=2, MaxPoolSize=20,
CreationTimeout=30)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[EventTrackingEnabled (true)]
public class XXXX : ServicedComponent, IXXXX.....

Where IXXXX is the public interface.

Can anyone tell me why I am still only get System.Exception on the client side of the COM+ boundary and not my custom exception

Cheers in advance

Ollie


Nov 16 '05 #3
Ollie,

I don't think that it should be discouraged, not at all. It's just a
pain, given the differences between the exception system of .NET and the
HRESULT-based error system of COM/COM+.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie" <ol**********@hotmail.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
Cheers for the reply Nick, I have re-read the article and now see my
mistake, but from your comment do you think passing custom exceptions from
serviced components should be discouraged?

Cheers

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:Oy**************@TK2MSFTNGP10.phx.gbl...
Ollie,

Custom exceptions being thrown from a serviced component are an ugly
thing. Check out the article in MSDN titled "Throwing Custom Exception
Types from a Managed COM+ Server Application", located at (watch for line
wrap):

http://msdn.microsoft.com/msdnmag/is...M/default.aspx

It will explain the issues involved.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie" <ol**********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am having problems with custom exceptions in COM+, I have read the

article
in MSDN (march 2004) and implemented the correct features....

The custom exception class derives of ApplicationException and also
has the
[Serializeable] attribute and has a
Serialization constructor and overriden implementation of

GetObjectData....

[Serializable]
public class BaseException : System.ApplicationException,
ISerializable......
The COM+ component is used in an object pool and has the following
attrbitues

[Transaction(TransactionOption.Required,
Isolation=TransactionIsolationLevel.Serializable, Timeout=60)]
[ObjectPooling(Enabled=true, MinPoolSize=2, MaxPoolSize=20,
CreationTimeout=30)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[EventTrackingEnabled (true)]
public class XXXX : ServicedComponent, IXXXX.....

Where IXXXX is the public interface.

Can anyone tell me why I am still only get System.Exception on the

client side of the COM+ boundary and not my custom exception

Cheers in advance

Ollie



Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: David Turner | last post by:
Hi all I noticed something interesting while testing some RAII concepts ported from C++ in Python. I haven't managed to find any information about it on the web, hence this post. The problem...
21
by: dkcpub | last post by:
I'm very new to Python, but I couldn't find anything in the docs or faq about this. And I fished around in the IDLE menus but didn't see anything. Is there a tool that can determine all the...
26
by: OvErboRed | last post by:
I just read a whole bunch of threads on microsoft.public.dotnet.* regarding checked exceptions (the longest-running of which seems to be <cJQQ9.4419 $j94.834878@news02.tsnz.net>. My personal...
22
by: Drew | last post by:
How do I know which exceptions are thrown by certain methods? For example, reading a file might throw an IO Exception, etc. In Java, the compiler won't even let you compile unless you put your...
0
by: Ollie | last post by:
I am having problems with custom exceptions in COM+, I have read the article in MSDN (march 2004) and implemented the correct features.... The custom exception class derives of...
14
by: dcassar | last post by:
I have had a lively discussion with some coworkers and decided to get some general feedback on an issue that I could find very little guidance on. Why is it considered bad practice to define a...
1
by: Anonieko | last post by:
Understanding and Using Exceptions (this is a really long post...only read it if you (a) don't know what try/catch is OR (b) actually write catch(Exception ex) or catch{ }) The first thing I...
2
by: Zytan | last post by:
I know that WebRequest.GetResponse can throw WebException from internet tutorials. However in the MSDN docs: http://msdn2.microsoft.com/en-us/library/system.net.webrequest.getresponse.aspx It...
0
RedSon
by: RedSon | last post by:
Chapter 3: What are the most common Exceptions and what do they mean? As we saw in the last chapter, there isn't only the standard Exception, but you also get special exceptions like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.