Could not load file or assembly 'Microsoft.Practices.ObjectBuilder2

Topics: Caching Application Block , General discussion
May 7, 2010 at 8:10 AM

This is a continuation of the thread in http://unity.codeplex.com/Thread/View.aspx?ThreadId=211786

How did you obtain your copy of the entlib assemblies?  Where did you download it? 

In your config, does your entlib assemblies have publickeytokens?  If yes, make sure that you have the strong-named version of the assemblies.  To check this, try if you can place those assemblies in GAC.  If you can't , then they're not strong-named.   You can obtain the strong-named versions by installing entlib, or if you already did, it's in the bin folder of the Enterprise Library installation folder.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
 entlib.support@avanade.com 

May 7, 2010 at 8:22 AM

I got the dll from http://hornget.net/packages/web/asp.net.mvc/mvccontrib/mvccontrib-trunk.

I have something like that:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
  <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
  <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
    </assemblyBinding>
 
How to place the assemblies in GAC?
From where can I have entlib? 

 

May 7, 2010 at 8:31 AM

That is the System.Web.Mvc assembly, you have to look for any entlib assembly, caching or logging or whatever you have in your config.  EntLib 4.1 can be downloaded here - http://www.microsoft.com/downloads/details.aspx?FamilyId=1643758B-2986-47F7-B529-3E41584B6CE5&displaylang=en

"How to place the assemblies in GAC?" - If you're working on XP, you just simply drag the assembly to C:\Windows\assembly folder.  If you're on Win7 or WinVista, you need to install assemblies to GAC using the msiexec command.  Remember that you only want to know if you're assembly is strong-named so if you were able to place them in GAC, remove them again if you're app doesn't need it to be there.

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
 entlib.support@avanade.com 

May 7, 2010 at 8:44 AM

I have the following:

    <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching" />

<cachingConfiguration defaultCacheManager="Default Cache Manager">
    <backingStores>
      <add name="persistent" partitionName="CacheIsolated" encryptionProviderName=""
				type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.IsolatedStorageBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching" />
    </backingStores>
    <cacheManagers>
      <add name="Persistent Cache Manager"
				type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching"
				expirationPollFrequencyInSeconds="3600"
				maximumElementsInCacheBeforeScavenging="1000"
				numberToRemoveWhenScavenging="10"
				backingStoreName="persistent" />
    </cacheManagers>
  </cachingConfiguration>

The assemblies Microsoft.Practices.EnterpriseLibrary.Caching.dll , and Microsoft.Practices.EnterpriseLibrary.Common.dll are not strongly named.  However, the Microsoft.Practices.ObjectBuilder2.dll is strongly named. How to proceed now?

May 7, 2010 at 9:11 AM

You could download and install entlib 4.1.  You will have the option to install the source code too, so go ahead and install it.  Get the unsigned version of ObjectBuilder2 from EntLib41src\bin folder (location of the source code).

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
 entlib.support@avanade.com 

May 7, 2010 at 9:17 AM

Thank you very much, it has solved my problem.