472,353 Members | 1,387 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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 1749
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steve O'maley | last post by:
I currently have the Exception Management Application Block working in my base directory, but when I create pages in a subfolder the Exception...
1
by: Abelardo Vacca | last post by:
Hello, Could anyone point out advantages and disadvantages of Apache's Log4net and Microsoft's Exception Management Application Block? I am...
6
by: Páll Ólafsson | last post by:
Hi I have a problem with the Microsoft.ApplicationBlocks.ExceptionManagement? I can't get it to work in RELEASE mode? If I run the project in...
5
by: PCC | last post by:
I am using the Exception Managment Application Block on Windows Server 2003 Enterprise and .NET v1.1. If I use the block with an ASP.NET web...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts...
7
by: Lucas | last post by:
Hi, I have an ASP.Net application written with VS.Net 2002 (Net FWK 1.0). This Web Application uses Exception Management Application Block to log...
1
by: Andy | last post by:
Hi All, I'm basically just trying to get started with the Exception Management Application Block and am having some technical difficulties. All...
1
by: Ellis Yu | last post by:
Dear All, I used VB.Net to write an application which use the exception management in Application Block as error handling. When I deploy the...
1
by: =?Utf-8?B?QnJldHQgT3NzbWFu?= | last post by:
I'm trying to set up a custome e-mail publisher for a web app using the Microsoft Exception Management Application Block for .NET sample app. Our...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.