Hello,

I am having problems throwing an exception from the Constructor of a pooled
.NET component inside COM+. When a I throw the error, the message received
in a .NET client is "Exception from HRESULT: 0x80131500", and the message
received in a VB 6.0 client is a simple "Automation error".

As soon as I turn off the "Enable object pooling" flag in the component
properties of my COM+ package, I get the correct exception message back to
the client (the one I typed into my throw statement).

Also, this only happens when I throw the exception from the constructor. If
I throw the exception from any other method, it works fine.

Does anybody know why this is?

It makes no difference if the .NET dll is in the GAC.

Thank you,
-Kuthair


Some sample code:
=================================

using System;
using System.EnterpriseServices;

// Application name
[assembly: ApplicationName("PooledDll")]

// Activate components in a dedicated server process
[assembly: ApplicationActivation(ActivationOption.Server)]

namespace PooledDll
{
   // Enable object pooling with these defaults
   [ObjectPooling(true, 4, 12, CreationTimeout = 20000)]

   // Enable JIT activation
   [JustInTimeActivation(true)]

   // Enable statistics
   [EventTrackingEnabled(true)]

   public class PooledDll : ServicedComponent
   {
       public PooledDll()
       {
           throw new System.Exception("Hello, this is an exception
message.");
       }

       public void DoWork()
       {
           // do some work
       }
   }
}




_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to