Could not load file or assembly...


G

Guest

Hi,

I am developing a middle tier WCF server called BusinessLogic, using the
Enterprise Library. Although I posted similar question on the EL forums (no
answer yet), it seems to me that the problem is more general .NET related
than WCF or EL specific. The problem shows when EL exception handling block
catches one exception and according to a policy throws different exception:
FaultException<SomeFaultFromBusinessLogic>. When the app. block tries to load
the fault class from BusinessLogic.dll it throws an exception saying that it
cannot find BusinessLogic ver. 1.0.0.2719 but the funny thing is that my
assembly is 1.0.0.1234. No matter what version is the assembly it always
tries to load ver. 1.0.0.2719. Can you please help - this has been haunting
me for weeks now.

Thank you
Val

A first chance exception of type 'Abc.BusinessLogic.FieldNullException'
occurred in BusinessLogic.dll
General Information: 1 : Timestamp: 10/8/2007 8:17:18 AM
Message:
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionHandlingException:
Could not load file or assembly 'BusinessLogic, Version=1.0.0.2719,
Culture=neutral, PublicKeyToken=25be6966e7e7a65e' or one of its dependencies.
The located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040) --->
System.IO.FileLoadException: Could not load file or assembly 'BusinessLogic,
Version=1.0.0.2719, Culture=neutral, PublicKeyToken=25be6966e7e7a65e' or one
of its dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'BusinessLogic, Version=1.0.0.2719, Culture=neutral,
PublicKeyToken=25be6966e7e7a65e'
at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&
stackMark, Boolean loadTypeFromPartialName)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.Configuration.FaultContractHandlerAssembler.Assemble(IBuilderContext
context, ExceptionHandlerData objectConfiguration, IConfigurationSource
configurationSource, ConfigurationReflectionCache reflectionCache)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory`2.Create(IBuilderContext
context, TConfiguration objectConfiguration, IConfigurationSource
configurationSource, ConfigurationReflectionCache reflectionCache)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntryCustomFactory.Create(IBuilderContext
context, ExceptionTypeData objectConfiguration, IConfigurationSource
configurationSource, ConfigurationReflectionCache reflectionCache)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyCustomFactory.CreateObject(IBuilderContext
context, String name, IConfigurationSource configurationSource,
ConfigurationReflectionCache reflectionCache)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext
context, Type t, Object existing, String id)
at Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext
context, Type typeToBuild, Object existing, String idToBuild)
at
Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext
context, Type typeToBuild, Object existing, String idToBuild)
at Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext
context, Type typeToBuild, Object existing, String idToBuild)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext
context, Type t, Object existing, String id)
at
Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator
locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[]
transientPolicies)
at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator
locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[]
transientPolicies)
at
Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUpTTypeToBuild(IReadWriteLocator
locator, String idToBuild, Object existing, PolicyList[] transientPolicies)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUpT(IReadWriteLocator
locator, String id, IConfigurationSource configurationSource)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.LocatorNameTypeFactoryBase`1.Create(String name)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.GetExceptionPolicy(Exception
exception, String policyName, ExceptionPolicyFactory factory)

=== Pre-bind state information ===
LOG: User = VTMELAMED\valo
LOG: DisplayName = BusinessLogic, Version=1.0.0.2719, Culture=neutral,
PublicKeyToken=25be6966e7e7a65e
(Fully-specified)
LOG: Appbase =
file:///C:/Users/valo/Documents/Projects/Abc/Abc.dev/Main/US/BusinessLogic/BusinessLogicExecutable/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly :
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF, Version=3.1.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file:
C:\Users\valo\Documents\Projects\Abc\Abc.dev\Main\US\BusinessLogic\BusinessLogicExecutable\bin\Debug\BusinessLogicExecutable.vshost.exe.config
LOG: Using machine configuration file from
C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: BusinessLogic, Version=1.0.0.2719,
Culture=neutral, PublicKeyToken=25be6966e7e7a65e
LOG: Attempting download of new URL
file:///C:/Users/valo/Documents/Projects/Abc/Abc.dev/Main/US/BusinessLogic/BusinessLogicExecutable/bin/Debug/BusinessLogic.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing
terminated.

--- End of inner exception stack trace ---
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.GetExceptionPolicy(Exception
exception, String policyName, ExceptionPolicyFactory factory)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception
exceptionToHandle, String policyName, ExceptionPolicyFactory policyFactory)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception exceptionToHandle, String policyName)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.ExceptionShieldingErrorHandler.ProvideFault(Exception
error, MessageVersion version, Message& fault)
Category: General
Priority: -1
EventId: 1
Severity: Information
Title:
Machine: DOLORES
App Domain: BusinessLogicExecutable.vshost.exe
ProcessId: 5540
Process Name:
C:\Users\valo\Documents\Projects\Abc\Abc.dev\Main\US\BusinessLogic\BusinessLogicExecutable\bin\Debug\BusinessLogicExecutable.vshost.exe
Thread Name:
Win32 ThreadId:7992
Extended Properties: HandlingInstance ID: -
acda3991-9cc1-4674-a467-63cc86bbf574
 
Ad

Advertisements

A

Alvin Bruney [MVP]

Start by purging your machine of all the dll's related to that assembly.
Then, perform a clean and then a build. Post back here if you make no
progress.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless Author Plug
OWC Black Book 2nd Edition
Exclusively on www.lulu.com/owc
$24.99


Val said:
Hi,

I am developing a middle tier WCF server called BusinessLogic, using the
Enterprise Library. Although I posted similar question on the EL forums
(no
answer yet), it seems to me that the problem is more general .NET related
than WCF or EL specific. The problem shows when EL exception handling
block
catches one exception and according to a policy throws different
exception:
FaultException<SomeFaultFromBusinessLogic>. When the app. block tries to
load
the fault class from BusinessLogic.dll it throws an exception saying that
it
cannot find BusinessLogic ver. 1.0.0.2719 but the funny thing is that my
assembly is 1.0.0.1234. No matter what version is the assembly it always
tries to load ver. 1.0.0.2719. Can you please help - this has been
haunting
me for weeks now.

Thank you
Val

A first chance exception of type 'Abc.BusinessLogic.FieldNullException'
occurred in BusinessLogic.dll
General Information: 1 : Timestamp: 10/8/2007 8:17:18 AM
Message:
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionHandlingException:
Could not load file or assembly 'BusinessLogic, Version=1.0.0.2719,
Culture=neutral, PublicKeyToken=25be6966e7e7a65e' or one of its
dependencies.
The located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040) --->
System.IO.FileLoadException: Could not load file or assembly
'BusinessLogic,
Version=1.0.0.2719, Culture=neutral, PublicKeyToken=25be6966e7e7a65e' or
one
of its dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'BusinessLogic, Version=1.0.0.2719, Culture=neutral,
PublicKeyToken=25be6966e7e7a65e'
at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&
stackMark, Boolean loadTypeFromPartialName)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.RuntimeType.PrivateGetType(String typeName, Boolean
throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.Configuration.FaultContractHandlerAssembler.Assemble(IBuilderContext
context, ExceptionHandlerData objectConfiguration, IConfigurationSource
configurationSource, ConfigurationReflectionCache reflectionCache)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory`2.Create(IBuilderContext
context, TConfiguration objectConfiguration, IConfigurationSource
configurationSource, ConfigurationReflectionCache reflectionCache)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntryCustomFactory.Create(IBuilderContext
context, ExceptionTypeData objectConfiguration, IConfigurationSource
configurationSource, ConfigurationReflectionCache reflectionCache)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyCustomFactory.CreateObject(IBuilderContext
context, String name, IConfigurationSource configurationSource,
ConfigurationReflectionCache reflectionCache)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext
context, Type t, Object existing, String id)
at
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext
context, Type typeToBuild, Object existing, String idToBuild)
at
Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext
context, Type typeToBuild, Object existing, String idToBuild)
at
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext
context, Type typeToBuild, Object existing, String idToBuild)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext
context, Type t, Object existing, String id)
at
Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator
locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[]
transientPolicies)
at
Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator
locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[]
transientPolicies)
at
Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUpTTypeToBuild(IReadWriteLocator
locator, String idToBuild, Object existing, PolicyList[]
transientPolicies)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUpT(IReadWriteLocator
locator, String id, IConfigurationSource configurationSource)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.LocatorNameTypeFactoryBase`1.Create(String
name)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.GetExceptionPolicy(Exception
exception, String policyName, ExceptionPolicyFactory factory)

=== Pre-bind state information ===
LOG: User = VTMELAMED\valo
LOG: DisplayName = BusinessLogic, Version=1.0.0.2719, Culture=neutral,
PublicKeyToken=25be6966e7e7a65e
(Fully-specified)
LOG: Appbase =
file:///C:/Users/valo/Documents/Projects/Abc/Abc.dev/Main/US/BusinessLogic/BusinessLogicExecutable/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly :
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF,
Version=3.1.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file:
C:\Users\valo\Documents\Projects\Abc\Abc.dev\Main\US\BusinessLogic\BusinessLogicExecutable\bin\Debug\BusinessLogicExecutable.vshost.exe.config
LOG: Using machine configuration file from
C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: BusinessLogic, Version=1.0.0.2719,
Culture=neutral, PublicKeyToken=25be6966e7e7a65e
LOG: Attempting download of new URL
file:///C:/Users/valo/Documents/Projects/Abc/Abc.dev/Main/US/BusinessLogic/BusinessLogicExecutable/bin/Debug/BusinessLogic.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing
terminated.

--- End of inner exception stack trace ---
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.GetExceptionPolicy(Exception
exception, String policyName, ExceptionPolicyFactory factory)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception
exceptionToHandle, String policyName, ExceptionPolicyFactory
policyFactory)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception
exceptionToHandle, String policyName)
at
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.ExceptionShieldingErrorHandler.ProvideFault(Exception
error, MessageVersion version, Message& fault)
Category: General
Priority: -1
EventId: 1
Severity: Information
Title:
Machine: DOLORES
App Domain: BusinessLogicExecutable.vshost.exe
ProcessId: 5540
Process Name:
C:\Users\valo\Documents\Projects\Abc\Abc.dev\Main\US\BusinessLogic\BusinessLogicExecutable\bin\Debug\BusinessLogicExecutable.vshost.exe
Thread Name:
Win32 ThreadId:7992
Extended Properties: HandlingInstance ID: -
acda3991-9cc1-4674-a467-63cc86bbf574
 
G

Guest

Alvin,

Thank you for your response. Unfortunately, I have tried that before and
tried it again today and still get the same...

Any other ideas? I'll appreciate it.

Thank you
Val
 
Ad

Advertisements

M

meetarifmd

I ran thru the same problem this morning.
After a careful thought, it sounds like both WCF and .Net combination problem.
The server (WCF) was upgraded recently and I was expecting the client to connect to at least some basic services(the first service which lets client to know if it needs to update) and then passes parameters to update. But theWCF service dictates the client to load DLL of the WCF server version, which the client doesn't have. As such exception is throw.

Plans to change the first connecting service, independent of all other DLLs..
Hope this might solve our autoupdate module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top