locked
Error in microsoft enterprise library configuratoin RRS feed

  • Question

  • Hi I am using microsoft enterprise library 5.0 in visual studio 2010. while I am using data access application block the fallowing error is coming.

    An error occurred creating the configuration section handler for dataConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, 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.

    I dont know what to do to fix this problem. please help me soon . I need this urjent

    Wednesday, April 3, 2013 6:14 AM

Answers

  • This can occur if you have mixed versions of the EntLib.  The EntLib assemblies can be installed into the GAC or used locally by an application.  If they are installed into the GAC then you need to ensure that your application is getting all the EntLibs from the GAC.  Normally the EntLib assemblies shouldn't be put into the GAC but I believe there is either an option when you install the EntLib binaries or a post-install command line you can use.  The "preferred" approach going forward would be to get the assemblies from NuGet.  This would keep the assemblies local. 

    Ensure that you are using the NuGet packages for EntLibs.  Then ensure that you have a reference to the Data assembly mentioned earlier.  Also note that most assemblies have a separate .Configuration assembly that is also generally needed.  Be sure to include that as a reference as well.  If you don't, you're using the NuGet packages and the EntLibs are GACed then you might run into the error you're seeing.

    Michael Taylor - 4/3/2013
    http://msmvps.com/blogs/p3net

    • Proposed as answer by Mike Feng Thursday, April 4, 2013 5:28 AM
    • Marked as answer by Mike Feng Tuesday, April 9, 2013 2:50 PM
    Wednesday, April 3, 2013 2:20 PM