Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information
ravikanth | August 23, 2010After getting latest code from TFS, I compiled and installed the latest build assemblies in GAC and from then my commerce server application stopped working. I was getting error “Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information”. The stack trace is shown below.
|
[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.] System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark) +0 System.Reflection.Assembly.GetTypes() +205 Microsoft.CommerceServer.Internal.Orders.Storage.SchemaMapping.LoadAssemblies(TypeDefinition[] typeDefs, MappingResults results) +6473 Microsoft.CommerceServer.Internal.Orders.Storage.SchemaMapping.ReadMapping(Stream stream, TypeDefinition[] typeDefinitions, MappingResults& outResults) +191 Microsoft.CommerceServer.Internal.Orders.Storage.SchemaMapping.ReadMapping(String filename, TypeDefinition[] typeDefinitions, MappingResults& outResults) +433 Microsoft.CommerceServer.Runtime.Orders.OrderContext.CreateSchemaAndPipelineMapping(SchemaMapping& schemaMapping, PipelineAdapter& pipelineAdapter, String appRootPath, CommerceOrdersConfiguration ordersConfiguration) +164 Microsoft.CommerceServer.Runtime.Orders.OrderContext.Initialize(String transactionResourceConnectionString, String transactionConfigResourceConnectionString) +321 Microsoft.CommerceServer.Runtime.Orders.OrderContext.Create(String transactionResourceConnectionString, String transactionConfigResourceConnectionString) +161 Microsoft.CommerceServer.Runtime.Orders.CommerceOrderModule.CreateOrderContext() +90 Microsoft.CommerceServer.Runtime.Orders.CommerceOrderModule.get_OrderContext() +138 Microsoft.CommerceServer.Runtime.Orders.CommerceOrderModule.OnBeginRequest(Object sender, EventArgs e) +24 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171 |
By seeing the stack trace, we can easily figured out that this error is commerce server (Microsoft.CommerceServer.Runtime) and it may not able to load the assemblies mentioned in the types section in web.config file but the assemblies (runtime and custom assemblies) are already exist in GAC. I binged, but not able to find concrete solution as this error is not specific to commerce server. I checked commerce server web services and found they are working fine and came to narrow conclusion that this error is due to some of the application code (not Commerce server assemblies).
Finally, I uninstall all application assemblies from GAC, does fresh compilation (rebuild) and put the new assemblies in GAC which has fixed this error (I have done machine restart due to some other issue). This looks strange but I felt that one of the assembly might of not compiled properly nor got register in GAC properly which has triggered this error. So, if you are getting same error in commerce then do the same way and hopes this will fix the issue.