Solved

Exception Management Application Block - Custom Publisher - HOW??

Posted on 2004-04-26
5
467 Views
Last Modified: 2013-12-03
Greetings
I'm following Microsoft's instructions to create a custom exception publisher, but no matter what I try, it keeps sending my errors to the DefaultPublisher.
My main project is called RMSC.ACME; the output is RMSC.ACME.exe.  As per MS's instructions, I created a RMSC.ACME.exe.config file, containing the following:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="exceptionManagement"
       type="Microsoft.ApplicationBlocks.ExceptionManagement
       .ExceptionManagerSectionHandler,
       Microsoft.ApplicationBlocks.ExceptionManagement" />
  </configSections>
      
  <exceptionManagement>
    <publisher mode="on" assembly="RMSC.Errors"
       type="RMSC.Errors.RMSCExceptionPublisher"
       connectString="blahblah"
       operatorMail="admin@blah.com" />
  </exceptionManagement>
</configuration>

Then I have another project called RMSC.Errors, which contains a class called RMSCExceptionPublisher, in the namespace RMSC.Errors, which implements IExceptionPublisher.  RMSC.ACME references RMSC.Errors.

Any ideas why I'm still getting the default publisher?

Thanks,
Shaul
0
Comment
Question by:saulbehr
  • 3
  • 2
5 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10916300
Hi check this...

Configuring a Custom Publisher

After we creating a custom publisher component, we need to attach it with the Exception Manager. For this we use a .NET XML configuration file for Application. The following configuration file format shows how to configure the custom publisher.

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

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

<exceptionManagement mode="on">
<publisher assembly="CustomExceptionManagement"
type="CustomExceptionManagement.ExceptionPublisher"
operatorMail="seenivasa.ramadurai@its.verizon.com" />
<publisher assembly="CustomExceptionManagement"
type="CustomExceptionManagement.ExceptionPublisher" fileName="c:\VZMoneyError.txt" />
<publisher assembly="CustomExceptionManagement" type="CustomExceptionManagement.ExceptionXMLPublisher" exceptionFormat="xml" fileName="c:\VZMoneyError.XML" />
<publisher assembly="CustomExceptionManagement" type="CustomExceptionManagement.ExceptionXMLPublisher" exceptionFormat="xml" operatorMail="Nageswara.Tripuramallu@its.verizon.com" />
<publisher assembly="CustomExceptionManagement" type="CustomExceptionManagement.ExceptionXMLPublisher" exceptionFormat="xml"
MSMQName=".\ErrorLogsQ" />
</exceptionManagement>

</configuration>


best of luck..

R.K
0
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 500 total points
ID: 10916324
0
 

Author Comment

by:saulbehr
ID: 10916487
R.K:

Thanks for this - I already had this code.  The problem is that my application IGNORES the .config file altogether, and uses the DefaultPublisher anyway.
Is there some trick in the naming convention?  Or is there an explicit setting on the project that will make it use my .config file?
Maybe there's a problem because my project has a "." in the name - "RMSC.ACME"?

Thanks,
Shaul
0
 

Author Comment

by:saulbehr
ID: 10916517
Actually, I just answered that question myself: you need to name the file "App.config".
I was naming it "RMSC.ACME.exe.config"... well, live and learn.
BTW, this is not explicit anywhere in the Microsoft documentation - that documentation is exactly what led me to name the config file "AppName.exe.config".

Still, you pointed me at the article on codeguru.com that explained the solution - so the points are yours.

Thanks!
Shaul
0
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10916594
Hi Shaul,

i will always be there to help...
once again thank you foe accepting and
i will look forward to help you on more things in future..

best of luck..

R.K

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question