locked
Microsoft.Practices.EnterpriseLibrary.Logging, Could not load file or assembly RRS feed

  • Question

  • Hi

    I am implementing Logging Application Block to my web part code but getting runtime error.

    {"An error occurred creating the configuration section handler for loggingConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    am I missing some configuration ?

     

    Thanks

     

     

    Friday, June 17, 2011 2:14 PM

Answers

  • Hi,

    Please make sure that you are referencing above mentioned dlls from Enterprise Library installed directory and not from Source folders as generally public key token is not available for those assemblies.

     

     


    Ashraf ul Islam
    Sharepoint Consultant
    • Marked as answer by Rama o Rama Friday, June 17, 2011 4:02 PM
    Friday, June 17, 2011 2:40 PM
  • Hi,

    It seems to me that you are not referencing the right version of one of the following dll.

    Microsoft.Practices.EnterpriseLibrary.Common.dll

    Microsoft.Practices.EnterpriseLibrary.Logging.dll

    Microsoft.Practices.ServiceLocation.dll

     

    Its definitely not related to your logging configuration in App.Config / Web.config

     

     

     


    Ashraf ul Islam
    Sharepoint Consultant
    • Marked as answer by Rama o Rama Friday, June 17, 2011 4:02 PM
    Friday, June 17, 2011 2:24 PM

All replies

  • Hi,

    It seems to me that you are not referencing the right version of one of the following dll.

    Microsoft.Practices.EnterpriseLibrary.Common.dll

    Microsoft.Practices.EnterpriseLibrary.Logging.dll

    Microsoft.Practices.ServiceLocation.dll

     

    Its definitely not related to your logging configuration in App.Config / Web.config

     

     

     


    Ashraf ul Islam
    Sharepoint Consultant
    • Marked as answer by Rama o Rama Friday, June 17, 2011 4:02 PM
    Friday, June 17, 2011 2:24 PM
  • I am working on fresh machine which only have Enterprise Library 5.0 installed.
    • Proposed as answer by AnandhN Monday, April 6, 2020 6:11 PM
    • Unproposed as answer by AnandhN Monday, April 6, 2020 6:11 PM
    Friday, June 17, 2011 2:32 PM
  • Hi,

    Please make sure that you are referencing above mentioned dlls from Enterprise Library installed directory and not from Source folders as generally public key token is not available for those assemblies.

     

     


    Ashraf ul Islam
    Sharepoint Consultant
    • Marked as answer by Rama o Rama Friday, June 17, 2011 4:02 PM
    Friday, June 17, 2011 2:40 PM
  • Worked solution:

    In the app.config, when specifying the type for the "Microsoft.Practices.EnterpriseLibrary. .." - do not specify the attribute 'PublicToken'.

    type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener,   Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

    or

    type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=null"

    Just do this instead:

    type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral"

    Thanks

    Ap


    ap

    • Proposed as answer by P_Mahesh Wednesday, August 1, 2012 2:00 PM
    Tuesday, February 28, 2012 7:46 PM
  • Thanks a lot.. This resolved my  issue with loggigng !!
    Wednesday, August 1, 2012 2:01 PM