throwing exceptions from COM+

G

Guest

When trying to throw a custom exception from a COM+ component to a client
using an interface as suggested by microsoft i am getting an "Object
reference not set to an instance of an object."
However when executing the code outside of COM+ the application behaves
correctly.

Public Interface IExceptionGenerator
Sub GenerateException(ByVal Ex As Exception, ByVal SourceAssembly As
String, _
ByVal SourceModule As String, ByVal
SourceProcedure As String)
End Interface

<ClassInterface(ClassInterfaceType.AutoDual), _
Transaction(TransactionOption.Supported), _
Serializable()> _
Public Class ExceptionGenerator
Inherits ServicedComponent
Implements IExceptionGenerator

Public Sub New()
MyBase.new()
End Sub

Public Sub GenerateException(ByVal Ex As System.Exception, ByVal
SourceAssembly As String, ByVal SourceModule As String, ByVal SourceProcedure
As String) Implements IExceptionGenerator.GenerateException

Dim CustEx As New CustomException(Ex, SourceAssembly, SourceModule,
SourceProcedure)
Throw (CustEx)

End Sub
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top