.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Logging Application Block

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

I need some very good samples on how to use Enterprise Logging Application Block. 5.0. Any ideas please

View Complete Post

More Related Resource Links

Logging Application Block -- A GUID might be prepended to the filename of the log file



Here is my problem definintion.

I am using Microsoft.Practices.EnterpriseLibrary.Logging.dll 4.1 version. It is found that

"A GUID might be prepended to the filename of the log file".

I did some googling and came to know that this is known issue from the following link


So how to resolve this. Is there any cleaner approch that i can use.

Please do reply.

Thanks in advance.

Microsoft Enterprise Library 5.0 - Logging Application Block Activation Error


Hi folks,

I've been writing a class where I wanted to write the errors off to the OS EventLog. I was pointed towards the Logging Application Block. I used LogWriter successfully in a web page and transfer the code to the class so that I could have the functionality there.

I keep getting an {"Activation error occured while trying to get instance of type LogWriter, key \"\""} Error when I reach this line of code:

private LogWriter writer = EnterpriseLibraryContainer.Current.GetInstance<LogWriter>();

I had something similar with the daab getinstance call but I added the unity assemblies to the code and this resolved this. I thought this was the issue with this problem.

Could anyone tell me what I'm doing wrong?

Thanks in advance folks.

app.config code:


<?xml version="1.0" encoding="utf-8" ?>
        <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

Using the ConsoleTraceListener with the Enterprise Library 3.1 Logging Block


I'm new to using the Logging application block.  I think I have a pretty good handle on how things work.  However, I'm running into a problem.  I'm using the RollingFlatFileListener and I have formatted the logging template to be more like the logging we are replacing.  However, in our console apps when the ConsoleTraceListener is added it still logs it out in the default text template format.  Is there any way to get around this?  Currently it looks like I will have to create a new TraceListener called FormattedConsoleListener that allows a text formatter to be associated with it.  Is this the only way?

Microsoft Application Block for Data Access in .NET


Hi all,

I was rummaging the internet learning aspx and came across the concept of: Microsoft Application Block for Data Access in .NET

It seems great of course. The articles are all early 2003-5 such as


So the question is - is this tech still relevant and should I be using it?



PIAB And WCF: Integrating the Policy Injection Application Block with WCF Services


Using the PIAB you can enhance WCF services with policies such as validation, performance monitoring, authorization and caching without having to change a line of code.

Hugh Ang and David San Filippo

MSDN Magazine February 2008

Data Points: The Enterprise Library Data Access Application Block, Part 3


E nterprise applications can have a wide variety of data update requirements. Sometimes you need to save multiple rows of changes at once within a single transaction. Other times, the user must be allowed to enter multiple rows of data, send them to the database in a batch; and if a row or two fails, only the rows that succeeded should be committed and remain committed.

John Papa

MSDN Magazine October 2005

Data Points: The Enterprise Library Data Access Application Block, Part 2


Last month I explored the foundation of the Enterprise Library Data Access Application Block (DAAB) including how it all fits into an architecture (see Data Points: The Enterprise Library Data Access Application Block, Part 1).

John Papa

MSDN Magazine August 2005

Data Points: The Enterprise Library Data Access Application Block, Part 1


A solid data access later (DAL) can benefit an application by hiding redundant tasks, helping handle exceptions more gracefully, helping clean up resources more efficiently, and providing a layer of abstraction from the database.

John Papa

MSDN Magazine July 2005

Cryptography Application Block -- Symmetric Only?!

I am in the planning stages of developing an application and have been hoping to take advantages of the enterprise library.  I just noticed however that the Cryptography Application Block does NOT support asymmetric algorithms?  This is rather surprising.  On this topic i have a couple questions:   1- Why does the library presently only support symmetric algorithms?  2- When will support for asymmetric cryptographic algorithms be added to the library? 3- Does the enterprise library have the extensibility to allow one to implement additional algorithms for improved security in non-trusted deployment scenarios?   Thanks and best regards, Michael

Application block usage

Hi,There are so many applications in the Ms Enterprise Library but there is no good article on how to use them.Does anybody know how to use these application blocks in custom applications?ARe the Blocks built using Design patterns?If so can somebody point me to a resource where I can come to know the DP's used in the blocks.Thanks

How to create a Custom Exception Handler using Micorosft Exception Handling Application Block?

Dear Friends,Can any one let me know "How to create a Custom Exception Handler using Microsoft Exception Handling Application Blocks"I will be having a set of Exceptions which will be getting maintained in an XML File along with the User Friendly Messages for a particular Exception. Whenever an Exception occurs in the projects first it need to check with the Exceptions present in the XML File and need to display the concerned user friendly message for that particular exception to the user..I am not able to get an idea on "How to start with the Microsoft Exception Handler Application Block" to achieve this". Please help me in this regard...Thanks and Regards,G.V.N.Sandeep.

Custom search queries not logging except to Search Service Application



I have written custom web controls that run specialised search queries under SharePoint Server 2010, using both FullTExtSQL syntax and (more recently) Keyword syntax, using both the object model and the Search web service.

Unlike the OOTB microsoft search webparts, which log to the web analytics section of the individual site collections, my controls only log the queries performed to the Web Analytics section of the Search service application (within Central Administration).

I have looked at the OOTB webparts using relflector, and followed the Federated search process for how the queries get logged, and I can't see any reason why my controls are ignored. (The QUeryInfo object is built and the information logged when the Query is executed, so it should be done when my custom queries are executed.)

Could anyone enlighten me as to what is going on here?




Audit trail using logging block


Hi All,

I need to implement audit trail in my whole asp.net application. When a record get created, changed or deleted, i need to do an entry in database about username, datetime stamp, old and new record.

Can you please guide me on how to implement it at asp.net application level.

Should i use Microsoft Enterprise library logging block for this, as somebody told me that logging block will automatically create database table with all the entries i want.

Can somebody please verify whether all the columns i mention above will be catered by logging block.



How to Validate a Method through Validation Application Block


Can i use Validation block  to apply check on Method parameter e.g. we have USerMasterBO as input parameter and we want to check if MasterID provide when user access a method GetUserDetail(), then only it should go to function else return before it because of validation fails.

In other words like we have validation feature in Message Inspector on API can we do the same in Validation block?


Caching application block error


Hi Experts !

I am facing probelm with enterprise library when uploading my application to the Server

please help me !

Error :The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager, Cache Manager]) failed: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) (Strategy type ConfiguredObjectStrategy, index 2) 

Scale Up Enterprise Library Caching Application Block


CAB from MS is a very famous tool for the developers as it saves a lot of valuable time of the developers. But anyone who has decided to use CAB, should also keep into mind its limitations as well. The cache in EnltLib is stand alone and in-process in nature that’s why it can ends up with some scalability and reliability issues when used in a multi-server environment. But there are some party integrations which can over come this issue. The most popular way to overcome these limitations of CAB is the use of a distributed cache. The article about the drawbacks of CAB and it solutions can be a very helpful read in this regard. 

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend