glosrob glosrob - 1 month ago 21
C# Question

AutoMapper CS File Extremely Slow in Visual Studio 2015

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.

Answer

I have simmilar problem in my solution. By using ADK i found reason in my case. Resharper get all cpu perfomance. Point by point i exclude some features from it, and in result find decision.

Turn Off Resharper IntelliSense, allow work Visual Studio native IntelliSense.

Resharper menu -> Option -> Environment -> IntelliSense -> General

Set radio to Visual Studio.

After work with Autommaper CS file, i turn it back.


No idea what the matter of this, but i`m guess it Automapper new reflection engine, after update Automapper from 3.1.1 version i got this problem.

But now my CPU on 3-5% level.