Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automapper Intellisense not working in VS2015

I have VS2010, 12, 13, 15 on my machine. All versions except 15 (Enterprise) work with Intellisense for Automapper.

Code:

class Program
{
    static void Main(string[] args)
    {
        Mapper.CreateMap<B, C>()
            .ForMember(x => x.)    // this is where it breaks
    }
}

class B
{
    public string BB { get; set; }
}

class C
{
    public string CC { get; set; }
}

I have reproduced this on two machines now by:

  1. Creating a console project
  2. Adding a reference from Nuget for Automapper install-package automapper
  3. Writing the above code

In previous VS versions, as soon as I hit the x => x. I get Intellisense with destination members.

like image 569
Sam Avatar asked Sep 25 '22 15:09

Sam


2 Answers

I faced a similar issue. What I have observed is you need to provide the complete syntax for the intellisense to show up

Copy-paste the sample code below and replace with your source and destinations. Then remove the sample items ".ChildDetails", you will start seeing intellisense!

Mapper.CreateMap<tblBusinessName, BusinessNameBO>() .ForMember(dest => dest.ChildDetails, m => m.MapFrom(s => s.tblBusinessNameChild));

like image 93
slipknot Avatar answered Sep 28 '22 05:09

slipknot


Try this:

  1. Update AutoMapper in VS2015 or delete AutoMapper and install
  2. In VS2015 check : Tools -> Options -> Text Editor -> All languages -> [Auto list members] and [Parameter Information]

what AutoMapper version you have installed?

like image 37
Denis Bubnov Avatar answered Sep 28 '22 06:09

Denis Bubnov