Where has TraceListenerAssembler gone?

Topics: Logging Application Block
Jul 13, 2011 at 3:57 PM
Edited Jul 13, 2011 at 4:53 PM


I have been using components generated with the Logging application block for years, but this is my first foray into the code itself, so if this is a dumb question please cut me some slack...

The company has a logging component which uses the logging application block. If I were to guess when it was built, I'd say 2005-ish. The version of the application block it used did not contain a RollingFlatFileTraceListener.

I have now come along an realised that a RollingFlatFileTraceListener is exactly what I need. So like an idiot I offered to upgrade this component. When I say "upgrade", I basically meant bringing it up to use the current version of Enterprise Library, v5. I didn't really envisage any more that that, since my thinking was that I would then get what I wanted out of the box.

Wrong. It turns out that this logging component has been modified at some point to contain a custom trace listener (which happens to log to the console). Among other things, the component contains a ....Assembler class, which derives from a class called TraceListenerAssembler. The problem is that when I reference the EntLib5 dlls, I get a compilation error saying that the TraceListenerAssembler class could not be found. Sure enough, I use the object browser and see that there is no such class within the Microsoft.Practices.EnterpriseLibrary.Logging.Configuration namespace (the file I'm looking in is Microsoft.Practices.EnterpriseLibrary.Logging.dll, version 5.0.414.0). (I get other compilation errors too, but since they are all in the region of this custom listener I'm happy to assume for now thay they're all related to this same problem.)

What I'm finding really strange is that the documentation for the previous version of Enterprise Library (4.1) on the MSDN contains loads of references to this class, but as soon as I look at the v5 documentation, nothing. Its like the class never existed. Even the 4.1 documentation doesn't say anything about the class being deprecated.

Presumably someone out there knows what happened between 4.1 and 5 - can you enlighten me?

Tech stuff: running everything on VS2010. I have upped the logging component to .net 4, although obviously I noticed that the binaries I get following the install of EntLib5 are .net 2. I don't really care about this for now. My o/s is XP, which I see is not claimed to be supported by EntLib5 ( - but surely that can't be the reason for my issues can it?)

Many thanks,


Jul 14, 2011 at 4:20 AM


According to Chris Tavares from this thread, assemblers, custom factories and all the object builder from previous version has been removed. I believe you need to rewrite your custom trace listener to be able to use it on Entlib 5. For the steps, refer to this link.


Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.

Jul 14, 2011 at 2:00 PM

Thanks Noel, that puts me in the picture.

Jul 15, 2011 at 12:38 PM
Edited Jul 15, 2011 at 12:46 PM

As a further update, a great example of the EntLib 5 way of dealing with custom Trace Listeners can be found on Stackoverflow, again from Chris Tavares.

Does anyone else see the irony that these blocks, which are intended as generic problem-solving snippets (and therefore a great idea), are so poorly documented by their authors?

Jul 17, 2011 at 4:48 AM

Have you looked at the Entlib 5 extensibility hands-on-labs? It goes into the details of how to build a variety of extensions to Enterprise Library, including custom trace listeners.

Jul 20, 2011 at 9:58 AM

chris I'm sure this link is useful and I'll make a note of it.

But my point was really that I already had a custom trace listener, which would no longer compile when I brought the EntLib 5 libraries into the project. It was frustrating that I couldn't find in any of the Entlib 5 documentation the reason why it would no longer work (i.e. that certain classes have been deprecated). I have absolutely no problem if the Entlib guys refactor things over time, its just after having read the relevant documentation I still had to resort to asking a question on Codeplex to find out what was going on.

Dunno, maybe my ignorance is just due to the fact that I've never had to work directly with the Enterprise Library before. Maybe if I had this would all be obvious.