Application Blocks Exception Management
Hi Folks
Has anyone out there experience of implementing Exception Blocks into an asp.net application?
I've intalled and referenced Microsoft.ApplicationBlocks.ExceptionManagement.dl l, and written a small routine to force a runtime error.
Sub Click(ByVal s As Object, ByVal e As EventArgs)
Dim x As Integer
Dim y As Integer
Try
x = 5 / y
Catch ex As Exception
ExceptionManager.Publish(ex)
End Try
End Sub
What I would like to do is publish the exception to a text file (pref an SQL db, so if anyone has some advice on this it would be good), but I'm getting to following error:
System.Security.SecurityException: Requested registry access is not allowed.
This is because the exception manager is trying to write to the application log.
Is it possible to simply write to the text file and not the application log?
My web.config code is as follows:
<section name="exceptionManagement" type="Microsoft.ApplicationBlocks.ExceptionManagem ent.ExceptionManagerSectionHandler,Microsoft.Appli cationBlocks.ExceptionManagement" />
Defined in <configSections>
And:
<exceptionManagement>
<publisher
mode="on"
assembly="CustomPublisher"
type="CustomPublisher.ExceptionPublisher"
include="*"
fileName="c:\CustomPub.txt" />
</exceptionManagement>
Any help and advice would be greatly appreciated.
TIA
Joe
|