U4-6245 - Feature Request 7.2.1 Update to AutoMapper version 3.3.0

Created by Pascal Albrecht 09 Feb 2015, 10:40:43 Updated by Shannon Deminick 16 Jun 2015, 08:20:13

Our Umbraco project is using the UmbracoCmsCore 7.2.1 NuGet package and I added another NuGet package to implement a custom feature. The added NuGet package depends on AutoMapper version 3.3.0, which caused an automatic update of the library for the project.

I expected Umbraco to run normaly after the AutoMapper update. However, the Umbraco libraries are explicitly comiled for AutoMapper version 3.0.0 and the Umbraco application fails to start with following error:

Could not load types from assembly businesslogic, Version=1.0.5462.37510, Culture=neutral, PublicKeyToken=null, errors: Exception: System.IO.FileLoadException: Could not load file or assembly 'AutoMapper, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'AutoMapper, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' To be able to use this library, Umbraco would need to be updated to AutoMapper version 3.3.0.

Comments

Sebastiaan Janssen 09 Feb 2015, 11:10:14

As a workaround for now you should be able to do an assembly redirect in your web.config.


Pascal Albrecht 09 Feb 2015, 13:51:31

It doesn't seem to be possible to use an assembly redirect because AutoMapper version 3.0.0.0 is referenced with a PublicKeyToken=null. However, AutoMapper version 3.3.0.0 seems to use PublicKeyToken=be96cd2c38ef1005.


Pascal Albrecht 09 Feb 2015, 13:55:28

@sebastiaan It doesn't seem to be possible to use an assembly redirect because AutoMapper version 3.0.0.0 is referenced with a PublicKeyToken=null. However, AutoMapper version 3.3.0.0 seems to use PublicKeyToken=be96cd2c38ef1005.


Sebastiaan Janssen 09 Feb 2015, 14:56:03

Maybe leave 3.0.0 in the bin and put 3.3.0 in it's own folder and do the redirect like this:


Pascal Albrecht 09 Feb 2015, 16:54:21

@sebastiaan The workaround with the codebase setting works. I added following setting to the assemblyBinding to guide Umbraco to AutoMapper version 3.0.0: This way we can let NuGet update the AutoMapper library as needed, while Umbraco has its desired version.


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.3.0

Sprint:

Story Points:

Cycle: