[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 485
  • Last Modified:

Exception Management Application Block - Custom Publisher - HOW??

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
saulbehr
Asked:
saulbehr
  • 3
  • 2
1 Solution
 
rama_krishna580Commented:
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
 
saulbehrAuthor Commented:
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
 
saulbehrAuthor Commented:
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
 
rama_krishna580Commented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now