c# - Automapper Intellisense 在 VS2015 中不起作用

标签 c# visual-studio visual-studio-2015 automapper intellisense

我的机器上有 VS2010、12、13、15。除 15 (Enterprise) 之外的所有版本都适用于 Automapper 的 Intellisense。

代码:

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; }
}

我现在通过以下方式在两台机器上复制了它:

  1. 创建控制台项目
  2. 为 Automapper 添加来自 Nuget 的引用 install-package automapper
  3. 编写上面的代码

在以前的 VS 版本中,只要我点击 x => x.,我就会获得带有目标成员的 Intellisense。

最佳答案

我遇到了类似的问题。我观察到的是您需要提供完整的语法才能显示智能感知

复制粘贴下面的示例代码并替换为您的来源和目的地。然后删除示例项目“.ChildDetails”,您将开始看到智能感知!

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

关于c# - Automapper Intellisense 在 VS2015 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34891914/

相关文章:

visual-studio - Visual Studio 2010 中的多监视器支持

c - 查找文件操作的 CPU 使用率

visual-studio-2013 - 锁定计算机或启动另一个实例时 Visual Studio 崩溃

c# - 如何在 asp.net c# 中为 BasicDatePicker 分配属性?

c# - 如何使用 Azure 服务总线实现 FIFO 主题

c# - 使用 C# Linq 测试字符串是否包含字符串列表的一部分

c++ - 将 VS 2012 迁移到 VS 2015 后 C++ 项目中的 Xmemory 错误

c# - 在存储库线程中锁定单个 session 是否安全? (N休眠)

c++ - 模板方法运行,但 Visual Studio 2015 显示错误

c# - VS2015 中的自动完成 "Committed by typing the following characters"选项在哪里?