Solved

Exception Management Application Block - Custom Publisher - HOW??

Posted on 2004-04-26
5
457 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

706 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now