locked
The Transient Fault Handling Application Block and Exception Handling using Microsoft Enterprise Library RRS feed

  • Question

  • Hi,

    I am implementing The Transient Fault Handling Application Block into my Azure application. Also doing Exception Handling and Logging through Enterprise Library. Problem arising while doing both the task through configuration in config file. I am using following DLLs for implementing Transient Fault Handling:

    DLL          Version

    Microsoft.Practices.EnterpriseLibrary.Common.dll     5.0.505.0
    Microsoft.Practices.Unity       2.1.505.0
    Microsoft.Practices.Unity.Configuration      2.1.505.0
    Microsoft.Practices.Unity.Interception      2.1.505.0
    Microsoft.Practices.Unity.Interception.Configuration    2.1.505.0
    Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Configuration  5.0.1118.0
    Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling 5.0.1118.0
    Microsoft.Practices.TransientFaultHandling.Core     5.0.1118.0


    And For Exception Handling and Logging I am using following DLLs:

    DLL          Version

    Microsoft.Practices.EnterpriseLibrary.ExceptionHandling    5.0.505.0
    Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll  5.0.414.0

    The entire configuration is generated through configuration console tool.
    Now if I am using  version 5.0.414.0 for Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll then I am getting following exception at this line-
     RetryManager retryManager = EnterpriseLibraryContainer.Current.GetInstance<RetryManager>();

    {"An error occurred creating the configuration section handler for exceptionHandling: Could not load file or assembly

    'Microsoft.Practices.EnterpriseLibrary.Common, 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) (E:\\T fault Handle\\eTax_NET\\COM.TCS.eTax.Web\

    \web.config line 14)"}

    And if I am using  version 5.0.505.0 for Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll then I am getting following exception:

    {"An error occurred creating the configuration section handler for exceptionHandling: Could not load file or assembly

    'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, 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) (E:\\T fault Handle\\eTax_NET\

    \COM.TCS.eTax.Web\\web.config line 93)"}


    This is all due to mismatch in dll versioning and their dependencies. The DLL Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll is not available for version 5.0.505.0.

    However without using configuration everything working fine.

    Kindly suggest any way to resolve this issue.

    Wednesday, July 18, 2012 1:57 PM

Answers

All replies

  • Are you testing this scenario locally or in the cloud? If you're testing locally, can you make sure you've installed the correct version of Enterprise Library? Does it work in a normal ASP.NET/console application? If you're testing in the cloud, make sure you've set all Enterprise Library assemblys' Copy Local to true. Alternatively, you can use a startup task to install Enterprise Library in a web/worker role, or use a virtual machine that has Enterprise Library pre-installed.

    For questions specific to Enterprise Library, please post on http://entlib.codeplex.com/discussions


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

    • Marked as answer by Nagendra Nema Friday, July 20, 2012 6:09 AM
    Thursday, July 19, 2012 2:46 AM
  • Hi Arwind,

    Thanks for reply,

    I am testing it locally. I am using EnterpriseLibrary.WindowsAzure.TransientFaultHandling -Version 5.0.1118.0  for Transient Fault Handling and  Microsoft Enterprise Library 5.0 DLL's for Exception Handling and its logging.
    Both are working fine separately.

    Problem arises when I do both things together through configuration settings in web.config file and following exception comes up:

    {"An error occurred creating the configuration section handler for exceptionHandling: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, 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) (E:\\T fault Handle\\eTax_NET\\COM.TCS.eTax.Web\\web.config line 14)"}

    at line-

    RetryManager retryManager = EnterpriseLibraryContainer.Current.GetInstance<RetryManager>();

    As I mentioned in my previous post this is all due to mismatch in dll versioning and their dependencies. So I am looking for version 5.0.505.0 of DLL Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll which I could not find. I hope this could resolve this issue.


    Thursday, July 19, 2012 10:41 AM
  • Hi,

    You can find all releases of Enterprise Library on http://entlib.codeplex.com/releases. See if you can find the version you need.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

    Friday, July 20, 2012 3:49 AM
  • Thanks Arwind,

    I got my desired DLL version from  Microsoft Enterprise Library 5.0 Optional Update 1 by posting this issue on http://entlib.codeplex.com/discussions .

    As suggested by You.


    • Marked as answer by Nagendra Nema Friday, July 20, 2012 12:45 PM
    Friday, July 20, 2012 12:45 PM