Enterprise Lib 5.0 with WPF-Visual Studio 2010

Topics: Logging Application Block
Sep 18, 2011 at 10:24 PM

Im developing WPF application with Visual Studio 2010. For logging am trying to use the Enterprise Library 5.0. I've added 'Microsoft.Practices.EnterpriseLibrary.Logging' in Reference. Then am adding the using Statement as -

using Microsoft.Practices.EnterpriseLibrary.Logging ; and

using Microsoft.Practices.Enterprise.Common

when I tried to log anything inside the function like say -

Logger.Write("Test Log", "General");

am getting error as follows -

unknown build error, 'cannot resolve dependency to assembly 'Microsoft.Practices.EnterpriseLibrary.common, version =5.0.414.0, culture=neutral, Public Token ='something here' because it has not been preloaded. when using the Reflection only APIs, dependent assemblies must be pre-loadedor loaded n demand through the ReflectionOnlyAssemblyResolve event.

The one thing I guess Enterprise Lib doesn't work with windows XP so I developed the application on Win7 but getting same error there. I've Enterprise Library installed at location -

C:\Program Files\Microsoft Enterprise Library5.0.

I tried adding settings through 'Microsoft Enterprise 5.0 ConfigurationConsole but no help.

please help.

 

 



 





Sep 19, 2011 at 2:24 AM

Hi,

How did you add the reference to logging? Did you browse to the bin or did you locate it in the .NET tab?

Sep 19, 2011 at 3:07 AM

Hello CodeTrainer,

I tried both first through .Net tab and later through C:\Program Files\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Logging.dll, getting same ablve mentioned error.

Sep 19, 2011 at 4:19 AM

This is just a wild punch in the dark, but can you try installing EntLib 5.0 with optional update 1 and see if it works? The link is: http://www.microsoft.com/download/en/details.aspx?id=6836

Sep 20, 2011 at 9:45 AM

Hi,

Are you using Visual Studio 2010 SP1? It seems this is a known issue with Visual Studio SP1 as per this thread.

 

Noel Angelo Bolasoc
Avanade Software
Avanade, Inc.
Contact Us

Sep 20, 2011 at 8:19 PM
Edited Sep 20, 2011 at 8:20 PM

Hi,

I'm using Visual Studio 2010 - Premium.

Sep 21, 2011 at 3:26 AM

I see. Unfortunately, we can't reproduce it on our side. Maybe you can send us your sample repro so we can further investigate the issue. Send it to entlib.support@avanade.com

 

Noel Angelo Bolasoc
Avanade Software
Avanade, Inc.
Contact Us