I have a solution with 7 or 8 projects, none of which contain anything particularly exciting and all perform as well as you would expect (and indeed as well as other projects I have used on my current machine).
However, whenever I open either one of the AutoMapper MappingConfiguration files, Visual Studio grinds to halt, moving the cursor one space takes minutes at a time and trying to write code results in lots of swearing - lots and lots and lots of swearing.
It seems to only be this MappingConfig.cs
file. It is isn't even that large - maybe 30 mappings (cfg.CreateMap<Bar,Foo>();
) and in total 350 lines of code.
Has anyone experienced slowing of Visual Studio whilst using AutoMapper?
AutoMapper is 4.2 I believe and I am using Visual Studio 2015 Community Edition.
I experienced the same thing and reported an issue to the Github repo.
https://github.com/AutoMapper/AutoMapper/issues/2217
They saw this as a VS issue but I got a nice answer for AutoMapper 5.0 <
. Use AutoMapper Profile Instances
so that you can split the configuration to many separate files. This gives some real performance gains instead of having everything in one file.
https://github.com/AutoMapper/AutoMapper/wiki/Configuration#profile-instances
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With