Enterprise Library 4.1 and .NET Framework 4.0 Error(s)

Topics: Enterprise Library Core
Jun 17, 2011 at 5:52 PM

We are using Enterprise Library 4.1 quiet extensively and now we are adding Silverlight to the our projects.  In order to add Silverlight, we had to change the version of our web project from targeting .NET Framework 3.5 to .NET Framework 4.0.  The solution still compiles cleanly but whenever I try to run the application I am thrown the error listed below.  I can simply refresh the application and it goes away but it still needs to get resolved cause it is the first error anyone sees.

If I unload the Silverlight application and change the targeted version back to 3.5, then the issue goes away.  What gives?

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null'
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
at System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit)
at System.Web.UI.AssemblyCache.GetAjaxFrameworkAssemblyAttribute(Assembly assembly)
at System.Web.UI.ScriptManager.get_DefaultAjaxFrameworkAssembly()
at System.Web.UI.ScriptManager..ctor()
at ASP.heliosmaster_master.__BuildControlScriptManager() in ..\Code\SG.Helios.Web\HeliosMaster.master:line 14
at ASP.heliosmaster_master.__BuildControlMainForm() in ..\Code\SG.Helios.Web\HeliosMaster.master:line 13
at ASP.heliosmaster_master.__BuildControlTree(heliosmaster_master __ctrl) in ..\Code\SG.Helios.Web\HeliosMaster.master:line 1
at ASP.heliosmaster_master.FrameworkInitialize() in ..\2c065b04\ea36f1da\App_Web_p0wtfgnm.0.cs:line 0
at System.Web.UI.UserControl.InitializeAsUserControlInternal()
at System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)
at System.Web.UI.Page.get_Master()
at System.Web.UI.Page.ApplyMasterPage()
at System.Web.UI.Page.PerformPreInit()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Jun 21, 2011 at 3:34 AM

Hi,

From what location are you referencing the Entlib assemblies? Try to re-reference the assemblies from C:\Program Files\Microsoft Enterprise Library 4.1 - October 2008\bin and see if it works.

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com