473,397 Members | 1,950 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,397 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 1841
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 Management Application Block is never executed. The...
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 leaning towards log4net, but I've read it can give...
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 debug mode the block works fine but when I run the...
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 wervice or in a web application I get the following...
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 are: 1. The code the initiates any high-level...
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 Events to Windows Event Log. We registered the...
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 I want to do to begin with is create a simple...
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 application in the client machine, it's fine. However...
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 app already uses the Exception Management Block,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.