November Happy Hour will be moved to Thursday December 5th.

Upgrading from 3.5.7 to 3.5.9

Vote:
 

Hi, we need to upgrade from 3.5.7 to 3.5.9 in order to use the migration tool for IV4. I've done this on my local machine now, but am having problems. The error I'm getting is "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information." which usually means you have the wrong assemblies. I've had a look at this: http://antonkallenberg.com/2012/10/04/imagevault-3-unable-to-load-one-or-more-of-the-requested-types/ and if I understand it correctly you don't need to install them in the GAC as long as they're in the bin folder?

The references all go to the new version and the correct assemblies are in the bin folder (3.5.9.140). Not all assemblies were created when I did the upgrade, so I created a new site and took the assemblies from there. This is all the IV stuff in the web.config:






















 












So, the correct assemblies are in the bin folder, the references are correct, and the Leadtools folder is in the bin folder. Is there anything that I have missed out?

#91291
Oct 01, 2014 16:25
Vote:
 

Hi!

Version numbers for .net assemblies are a bit tricky.

The version that should be in the bindingRedirect attribute newVersion is the assembly version.

A .net dll can have up to three different versions., Assembly, File and informational version.

The file and informational version can be checked by rightclicking the dll file in windows explorer and selecting properties->Details.

File version and informational version (Product version) can be seen there.

The assembly version (that is used by .net) cannot be seen there, you need to use some other tool.

You can for instance do it with a powershell command

[System.Reflection.Assembly]::LoadFrom("YourDllName.dll").GetName().Version

In this case, the assembly version used in the newVersion attribute should be 3.5.9.0

Normally you should not need an assembly redirect on non strong named assemblies (and the iv3 assemblies are not strong named) so I'm a bit curious about the original error message. If you post the complete error message I can be able to help you further.

#91312
Oct 02, 2014 9:37
Vote:
 

Aah, thanks Dan, it did say 3.5.9.0 after upgrading but I tried with 3.5.9.140 as well in case that was the problem. Checked it in powershell and it is like you say, have changed it back now! This is the full error message:

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Source Error: 


[No relevant source lines]

Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\8cf0acc1\10d3c93b\App_global.asax.fi0mpke7.0.cs    Line: 0 

Stack Trace: 


[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
   System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
   System.Reflection.RuntimeModule.GetTypes() +4
   System.Reflection.Assembly.GetTypes() +70
   EPiServer.Events.ServiceModel.EventReplicationKnownTypesHelper.GetKnownTypes(ICustomAttributeProvider provider) +243

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +108
   System.ServiceModel.Description.TypeLoader.GetKnownTypes(Object[] knownTypeAttributes, ICustomAttributeProvider provider) +12804552
   System.ServiceModel.Description.TypeLoader.UpdateOperationsWithInterfaceAttributes(ContractDescription contractDesc, ContractReflectionInfo reflectionInfo) +72
   System.ServiceModel.Description.TypeLoader.LoadContractDescriptionHelper(Type contractType, Type serviceType, Object serviceImplementation) +227
   System.ServiceModel.Description.ContractDescription.GetContract(Type contractType, Type serviceType) +74
   System.ServiceModel.ServiceHost.CreateDescription(IDictionary`2& implementedContracts) +342
   System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +146
   System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +46
   System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +146
   EPiServer.Events.EventsInitialization.CreateEventServiceHost() +73
   EPiServer.Events.EventsInitialization.InitializeEvents(Boolean forcePublisher) +240
   EPiServer.Events.EventsInitialization.Initialize(InitializationEngine context) +137
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +336
   EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +83
   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +158
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +62
   EPiServer.Global..ctor() +54
   Avantime.Templates.Global..ctor() +4
   ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\8cf0acc1\10d3c93b\App_global.asax.fi0mpke7.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1136
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +128
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +18
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +260
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9950728
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254



#91316
Oct 02, 2014 10:31
Vote:
 

Well the error message indicates that .net has problem loading some referenced assembly. The message doesn't state which one unfortunately. You need to activate assembly bind failure logging (Fusion) to get information about which assembly that is missing.

See the following resources for more information.

http://ntcoder.com/bab/2013/09/23/net-setting-up-fusion-logging/

http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx

http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx

http://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net

#91320
Edited, Oct 02, 2014 10:52
Vote:
 

Det visade sig vara Leadtools.dll som var 64-bitars istället för 32-bitars! Hade enablat 32-bit applications i IIS men det funkade inte ändå. TACK! :)

#91321
Oct 02, 2014 13:13
Vote:
 

Ok. To use 64 bit dll:s you need to set Enable 32 bit to False in the apppool settings. If it is set to true, they will use 32-bit dll:s.

Usually when you get a mismatch with 64/32 bit dlls you get the BadImageFormat exceptions...

#91338
Oct 02, 2014 21:35
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.