using the toolkit with Microsoft.Practices.EnterpriseLibrary.Logging

Jan 14, 2011 at 3:24 PM


I started to use your framework and moved my previous code into a new project build on the templates provided.

In every viewmodel where I previously used the logging block from the Enterprice Library I get exceptions on the Unity.dll : Activation error occured while trying to get instance of type LogWriter, key \"\""} and the inner exception:

{"Resolution of the dependency failed, type = \"Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter\", name = \"(none)\".\r\nException occurred while: while resolving.\r\nException is: InvalidOperationException - The type LogWriter cannot be constructed. You must configure the container to supply this value.\r\n-----------------------------------------------\r\nAt the time of the exception, the container was:\r\n\r\n  Resolving Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter,(none)\r\n"}

Any help would be greatly appreciated.

Feb 10, 2011 at 1:28 PM

Hi Rudi,

Sorry for the delayed answer.

I think that your issue comes from your IOC. It sounds as if your logger was not registered properly.



Feb 15, 2011 at 1:53 PM

Hi Laurent,

Thank you for getting back to me. I believe the issue is fixed now. I indeed needed to register the logging block. I never heard of IOC, which was probably part of the issue.

Thanks for you help and keep on the great work.