AutoMapper 3.2.0 released

Full release notes on the GitHub site

Big features/improvements:

  • LINQ queryable extensions greatly improved
    • ICollection supported
    • MaxDepth supported
    • Custom MapFrom expressions supported (including aggregations)
    • Inherited mapping configuration applied
    • Windows Universal Apps supported
  • Fixed NuGet package to not have DLL in project
  • iOS confirmed to work
  • ReverseMap ignores both directions (only one Ignore() or IgnoreMap attribute needed)
  • Pre conditions on member mappings (called before resolving anything)
  • Exposing ResolutionContext everywhere, including current mapping engine instance

A lot of small improvements, too. I’ve ensured that every new extension to the public API includes code documentation. The toughest part of this release was coming up with a good solution to the multi-platform support and MSBuild’s refusal to copy indirect references to all projects.

As always, if you find any issues with this release, please report over on GitHub.

Enjoy!

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Jimmy Bogard

I'm a technical architect with Headspring in Austin, TX. I focus on DDD, distributed systems, and any other acronym-centric design/architecture/methodology. I created AutoMapper and am a co-author of the ASP.NET MVC in Action books.
This entry was posted in AutoMapper. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • wwb_99

    Congrats — great release.

    Isn’t always funny that getting the code going ends up being easier than getting the effing build tools to do what you want?

    • jbogard

      Dude. I don’t even want to think about how crazy it was to get the build server up and going. That required massive tequila.

      • wwb_99

        Lol. Let me tell you how entertaining build servers and drinking can get. Especially with automated SCM / notification integration . . .

  • http://blog.deltacode.be/ David De Sloovere

    Good job on solving the DLL reference thing!

  • http://six.dev-heaven.net Sickboy

    Congrats on another most awesome release Jimmy!

    I ran into this one yesterday; http://rogeralsing.com/2013/12/01/why-mapping-dtos-to-entities-using-automapper-and-entityframework-is-horrible/

    Are any of the changes relevant to the opted problem?

    • jbogard

      No, not really. Mapping back to tracked entities is a very difficult problem, and not because of AutoMapper, but because it’s just hard to do. Every time someone asks me to do so, I have them send me their current code w/o AutoMapper, and there’s nothing in there that looks easy or Auto.

      • http://six.dev-heaven.net Sickboy

        Fair enough

  • ByAngular Dom

    I reference automapper.dll and automapper.Net4.dll in my Sevice project,
    then I reference Service to my UI Project,

    I didn’t find AutoMapper.Net4.dll in in UI’s bin directory after i deploy my UI project

    why ,how to solve this problem .Is autoMapper.net4.dll needed in my project running ? my project is simple web project

    thanks

    • jbogard

      What version of AutoMapper?

      • ByAngular Dom

        thanks for your reply,the version of automapper which I using in my project is 3.2.1.

        my program can be compiled well even if i dont refence automapper.net4.dll.

        if I refence automapper.net4.dll in my UI project,that means I refence automapper.net4.dll and automapper.dll in both my Service project and UI project。of course,Sevice is refenced in UI Project.

        ok,problem is coming,I deploy my UI project on on IIS7.5,OS is windows Server 2008,the version framwork is .net4.0,the working type of IIS7.5 is Integrated pattern.

        when i run my website,the first method which using automappper to mapp a entity to a business object,this is an system exception.

        here is the error log below

        i am sorry that most of the log is writen by chinese ,eh, i try my best to translate some words to english

        “/”application server error。
        ——————————————————————————–

        can’t load the file or assemly “System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes” or some dll it depended, the assemply name or the basic code is invalid 。 (异常来自 HRESULT:0×80131047)
        说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

        异常详细信息: System.IO.FileLoadException: 未能加载文件或程序集“System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes”或它的某一个依赖项。给定程序集名称或基本代码无效。 (异常来自 HRESULT:0×80131047)

        源错误:

        执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

        程序集加载跟踪: 下列信息有助于确定程序集“System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes”未能加载的原因。

        警告: 程序集绑定日志记录被关闭。
        要启用程序集绑定失败日志记录,请将注册表值 [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD)设置为 1。
        注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
        要关闭此功能,请移除注册表值 [HKLMSoftwareMicrosoftFusion!EnableLog]。

        堆栈跟踪:

        [FileLoadException: 未能加载文件或程序集“System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes”或它的某一个依赖项。给定程序集名称或基本代码无效。 (异常来自 HRESULT:0x80131047)]
        AutoMapper.Internal.ProbingAdapterResolver.ProbeForPlatformSpecificAssembly() +0
        AutoMapper.Internal.ProbingAdapterResolver.Resolve(Type type) +164
        AutoMapper.Internal.PlatformAdapter.Resolve(Boolean throwIfNotFound) +75
        AutoMapper.ConfigurationStore..cctor() +18

        [TypeInitializationException: “AutoMapper.ConfigurationStore”的类型初始值设定项引发异常。]

        you can see the error log above , i am sure the reason caused this problem is automapper,

        the error position is in AutoMapper.ConfigurationStore..cctor() +18

        can you give me some help to solve this problem.

        thanks

        • jbogard

          Can you ask this on the mailing list? It’s hard to answer this on the blog comments.

          • ByAngular Dom

            sorry ,i couldn’t find an email address to contact you or your team. can i get your email.?

            may be email list is a better communication means to solve my problem。

            thanks

          • jbogard
        • Guest

          sorry ,i couldn’t find an email address to contact you or your team. can i get your email.?

          may be email list is a better communication means to solve my problem

          thanks

  • Craig Boland

    I’m curious how you solved the indirect reference problem. We had the same problem and solved it by adding a direct reference to our DI binding root, declaring an unused variable of a type in the references, and adding #pragma statements around them to suppress compiler warnings:

    #pragma warning disable 169, 414
    private static Common.Logging.Log4Net.Log4NetLogger a;
    private static log4net.ILog b;
    #pragma warning restore 169, 414