469,332 Members | 6,649 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,332 developers. It's quick & easy.

Problem With Exception Management Application Block

Hi All,

I'm basically just trying to get started with the Exception Management
Application Block and am having some technical difficulties. All I
want to do to begin with is create a simple Windows Application (which
I have done and named "ExceptionManagementTester") and within it
create and use a custom publisher.

The Exception Management Tester Solution contains ONE project with
these files:

Reference
App.Config
AssemblyInfo.vb
ExceptionPublisher.vb
Form1.vb
InterfaceDefinitions.vb

The contents of App.Config is shown below:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<configSections>
<section name="exceptionManagement"
type="Microsoft.ApplicationBlocks.ExceptionManagem ent.ExceptionManagerSectionHandler,Microsoft.Appli cationBlocks.ExceptionManagement"
/>
</configSections>

<exceptionManagement mode="on">
<publisher assembly="ExceptionManagementTester"
type="ExceptionManagementTester.ExceptionPublisher "
fileName="c:\QuickStartSamplesExceptionLog.txt" />
</exceptionManagement>

</configuration>

References are both made to ExceptionManagement and
ExceptionManagement.Interfaces. The form has a button on it with code
behind it that just creates an exception.

The problem I have is that when execution reaches the
PublishToCustomPublisher Method with the signature shown below in the
ExceptionManager Class

Private Shared Sub PublishToCustomPublisher(ByVal exception As
Exception, ByVal additionalInfo As NameValueCollection, ByVal
publisher As PublisherSettings)

it gives me "specified cast is not valid". Here is the exact line of
code it "blows up"

m_Publisher = CType(Activate(publisher.AssemblyName,
publisher.TypeName), IExceptionPublisher) . . . just after calling the
activate function

Apparently, it's blowing up in trying to convert from type "Object" to
type "IExceptionPublisher" and I don't understand why exactly.

Because I have very little experience with the Exception Management
Application Block I suspect it's something simple. I'm half wondering
if I can't do this all in ONE project for some reason.

At any rate, if anyone could shed some light on this for me it would
be greatly appreciated.

Thanks,

Andy
Jul 21 '05 #1
1 1637
Andy,

The most simple thing to find this problems is to pull them appart in
different rows using intermidiate values or objects for that.

I hope this helps?

Cor

"Andy" <ap*****@aol.com>
..
Hi All,

I'm basically just trying to get started with the Exception Management
Application Block and am having some technical difficulties. All I
want to do to begin with is create a simple Windows Application (which
I have done and named "ExceptionManagementTester") and within it
create and use a custom publisher.

The Exception Management Tester Solution contains ONE project with
these files:

Reference
App.Config
AssemblyInfo.vb
ExceptionPublisher.vb
Form1.vb
InterfaceDefinitions.vb

The contents of App.Config is shown below:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<configSections>
<section name="exceptionManagement"
type="Microsoft.ApplicationBlocks.ExceptionManagem ent.ExceptionManagerSectionHandler,Microsoft.Appli cationBlocks.ExceptionManagement"
/>
</configSections>

<exceptionManagement mode="on">
<publisher assembly="ExceptionManagementTester"
type="ExceptionManagementTester.ExceptionPublisher "
fileName="c:\QuickStartSamplesExceptionLog.txt" />
</exceptionManagement>

</configuration>

References are both made to ExceptionManagement and
ExceptionManagement.Interfaces. The form has a button on it with code
behind it that just creates an exception.

The problem I have is that when execution reaches the
PublishToCustomPublisher Method with the signature shown below in the
ExceptionManager Class

Private Shared Sub PublishToCustomPublisher(ByVal exception As
Exception, ByVal additionalInfo As NameValueCollection, ByVal
publisher As PublisherSettings)

it gives me "specified cast is not valid". Here is the exact line of
code it "blows up"

m_Publisher = CType(Activate(publisher.AssemblyName,
publisher.TypeName), IExceptionPublisher) . . . just after calling the
activate function

Apparently, it's blowing up in trying to convert from type "Object" to
type "IExceptionPublisher" and I don't understand why exactly.

Because I have very little experience with the Exception Management
Application Block I suspect it's something simple. I'm half wondering
if I can't do this all in ONE project for some reason.

At any rate, if anyone could shed some light on this for me it would
be greatly appreciated.

Thanks,

Andy

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Abelardo Vacca | last post: by
6 posts views Thread by Páll Ólafsson | last post: by
44 posts views Thread by craig | last post: by
1 post views Thread by =?Utf-8?B?QnJldHQgT3NzbWFu?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.