Namespace not recognized (even though it is there)
Check to make sure that your project isn't set up to use the .NET Framework 4 Client Profile.
You can check/change this by right-clicking your project (not the solution), select Properties -> Application -> Target framework. The target framework is a dropdown on that page.
This is a problem in Visual Studio (I would even go so far as to call it a bug). AutoMapper requires assemblies that are excluded from the .NET Framework 4 Client Profile. Since your project is using that version of the framework it breaks.
A similar error will propagate to the build process when the .NET Framework version for the project you are referencing is higher than the project making the reference. i.e. A project targeting 4.5 that references a project targeting 4.5.1 will give you this same error.
There needs to be a better error message when this happens because there is no rational explanation as to why it would not build as the error message tells you to reference an assembly you have clearly referenced.
This has to be the simplest solution if all the other answers does not help you
I was searching for what's wrong with my setup among the answers, Tried all of them - none worked, Then I realized Visual Studio 2018 was developed by Microsoft. So I did what most people do,
Restarted Visual Studio And It worked