Executing EntLib code from the COM object

Topics: Exception Handling Application Block, Logging Application Block
Aug 31, 2009 at 3:33 PM


I've created library which uses Logging and Exception Handling blocks. I referenced  this library from my Windows Form project and everything going well. But when I tried to execute my library code from my own COM object (it was instatiated from third party application) I got error "The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl, Data]) failed" when any exception is handled by Exception block. I think this happens because no application configuration file avalable (application configuration file is linked by default to *.exe projects and not to *.dll).  I tried add configuration file (and paste the same content) to my library project but this doesn't help.

Does somebody know how to solve this?

Sep 1, 2009 at 3:37 AM

I haven't used a COM object before but your guess that there's no application configuration file available seems to be the case.  I found this one - http://stackoverflow.com/questions/312906/how-to-get-a-net-ccw-assembly-to-load-configuration-from-a-dll-config, see if it helps.  If it doesn't I suggest you post this query on other .NET forums as this is more of a com interoperability-related question rather than an entlib question.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.

Sep 10, 2009 at 11:26 AM

Thank you! It does a trick!