Logger.Write(logEntry) is throwing runtime error

Topics: Logging Application Block
Aug 12, 2011 at 7:44 AM

Hi,

After migrating Entlib 2.0 to 5.0 in .Net 4.0, I am getting the below run time error in at the statement Logger.Write().

The type 'Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=null' cannot be resolved. Please verify the spelling is correct or that the full type name is provided.

Could you please let me know the values that can be passed to the type attribute for cacheManagers in web.config file.

 <cachingConfiguration defaultCacheManager="SWB Cache Manager">
  <cacheManagers>
   <add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="Null Storage" name="SWB Cache Manager" type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </cacheManagers>
  <backingStores>
   <add encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Null Storage"/>
  </backingStores>
 </cachingConfiguration>

 

Thanks,

Vijay

Aug 12, 2011 at 7:56 AM
Edited Aug 12, 2011 at 7:58 AM

Hi,

Are you referencing from the Entlib Installation Folder (Commonly in C:\Program Files\Microsoft Enterprise Library 5.0\Bin)? On your second question, you can pass a fully qualified assembly that inherits from ICacheManager.

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
Contact Us

Aug 12, 2011 at 8:44 AM

Hi,

Yes, I am referring to Entlib installtion folder.

Thanks,

Vijay

Aug 15, 2011 at 5:43 AM

I'm not sure why is your formatter has no Public Key Token. Can you post your whole configuration here? Also, can you check if your project is targeting the whole .NET 4.0 and not .NET 4.0 Client Profile?

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
Contact Us

Aug 17, 2011 at 7:19 AM

Hi,

The problem is solved now.

I have added public key Token and it started working.

Thanks,

Vijay