CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.microsoft_application_blocks Tags:
Item Type: NewsGroup Date Entered: 10/24/2007 2:50:01 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 81 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
Rippo
Asp.Net User
Enterprise Library exeception handling and extended properties....10/24/2007 2:50:01 PM

0/0

Hi, I wonder if anyone could help me with the enterprise library (3.1) exception handling and logging. I am trying to add Extended properties to a exception. I have worked out that that I can add extended properties to a LogEntry and this works well, however I cant seem to figure out how to add my own extended properties to an exception?

The following code which works really well but as you can guess I am receiving two notifications, one from the logger and one from the exception when really all I am trying to do is receive a single notification with the error and my own extended properties.

            Try
Throw New
Exception("A handled exception")
Catch ex As Exception

Dim logEntry As LogEntry = New LogEntry()
                logEntry.ExtendedProperties.Add("Collections", MyError.ProcessError(ex))
Logger.Write(logEntry)
HandleException(ex, "GlobalPolicy")
End Try

Note the method MyError.ProcessError(ex))  returns a string of all ASP.NET collections i.e. cookies, querystring, form, session

 

Rippo
Asp.Net User
Re: Enterprise Library exeception handling and extended properties....10/27/2007 2:11:33 PM

0/0

Ah found it, posted answer in case anybody else needs this! Simply add a name/valur pair to the exception Data collection. As long as you have Extended Properties: {dictionary({key} - {value} defined in your template in web,config

 

        ex.Data.Add("My name is:", "Rippo")
        ExceptionPolicy.HandleException(ex, "GlobalPolicy")
   
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
The Definitive Guide to the Microsoft Enterprise Library Authors: Keenan Newton, Pages: 492, Published: 2007
Microsoft ASP.NET: Fast & Easy Web Development Authors: Nitin Pandey, NIIT (Firm), Pages: 398, Published: 2002

Web:
Enterprise Library exeception handling and extended properties ... Enterprise Library exeception handling and extended properties.... Last post 10- 27-2007 10:11 AM by Rippo. 1 replies. Sort Posts: ...
Enterprise Library: Take Exception To Critical Errors With Custom ... The Enterprise Library Exception Block is used to report the exception by calling .... and any extended properties that were set up on the entry. ...
Exception handling in Enterprise Library 2.0 newbee question Exception handling in Enterprise Library 2.0 newbee question .... Extended Properties: {dictionary({key} - {value})}"/> ...
.NET Exception handling in Enterprise Library 2.0 newbee question I am new to the Enterprise Library and having a problem with exception handling .... Extended Properties: {dictionary({key} - {value})}"/> type="Microsoft. ...
CodeProject: Exception Handling & Logging Application Block ... Exception Handling & Logging Application Block: Enterprise Library 1.0 .... 1932 Thread Name: Extended Properties: ---------------------------------------- ...
Exception handling in Enterprise Library 2.0 newbee question Visit our forum to discuss Exception handling in Enterprise Library 2.0 newbee ... Extended Properties: {dictionary({key} - {value})}"/> ...
patterns & practices – Enterprise Library - Discussions May 7, 2008 ... Title:Enterprise Library Exception Handling Machine: ASD170 App Domain: DistributedTransactionDemo.exe ProcessId: 2572 ...
Share Source Code Exception Handling & Logging Application Block: Enterprise Library 1.0. This article illustrates how to log your Exception into trace.log file using ...
Scott Elkin Publish(ex); And if you wanted to log some extended properties you could Read ... in the new Enterprise Library Exception Handling Application Read More. ...
.net and c# and enterprise software and library Resources ... ... allowing the user to set certain extended properties for tables and columns ... Discover how the Microsoft Enterprise Library's Exception Handling Block ...




Search This Site:










create mydb object for every database operation?

reg:application blocks

ent lib 2.0 logging block timestamp offset by 4 hours

deploying exception handling block (enterprise library)

exception when use daab 2.0 to config web.config

logging application block basics

i am against the ui process block

timeout expired in enterprises library

enterprise library (june 2005) and medium trust

insert checkbox data into access in asp?

asynchronous insert

how to handle decimal precision & scale with daab addoutparameter?

cannot see exception/s details in my eventlog mmc viewer folder

enterprice library 3.0 (april 2007) issue - configuration won't save

aggregation block - number of improvements

how to use the same connection for multiple subsequent queries?

configure enterprise library from file website

cryptography application block - is it ok for an asp.net website?

database trace listener

system.security.securityexception: requested registry access is not allowed

parameter caching

problem | cache not holding on to items...

please help

back button and uip

randomly occurring error

exception management block

parameter order

cant open the .sln solution file for the application block

configuration problem

logging configuration and formatters

  Privacy | Contact Us
All Times Are GMT