[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Exception Management Application Block - Custom Publisher - HOW??

Posted on 2004-04-26
5
Medium Priority
?
484 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 1500 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

867 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