【问题标题】:AddAutoMapper not found in .NET Core with AutoMapper使用 AutoMapper 在 .NET Core 中找不到 AddAutoMapper
【发布时间】:2019-05-19 20:41:56
【问题描述】:

使用 Visual Studio 2019,我通过 NuGet 安装了 AutoMapper 版本 8.1.0。当我尝试在我的Startup.cs 文件中添加services.AddAutoMapper() 调用时,我收到一个编译器错误,该方法不存在。

我已经尝试从 NuGet 控制台执行 dotnet cleandotnet restore 但这没有帮助。

【问题讨论】:

  • 谢谢,@LucianBargaoanu。我已经安装了你的基础包,但没有意识到你的 NuGet 链接指向不同的包。此外,“此处”链接指向 404。
  • 我看到了,但我不知道为什么。欢迎 PR :)

标签: automapper automapper-8


【解决方案1】:

这是一个旧线程,但是解决此问题的方法是安装 Automapper.Extensions.Microsoft.DependencyInjection 软件包以及您的 automapper 软件包。 希望对你有帮助。

【讨论】:

    猜你喜欢
    • 2021-07-26
    • 1970-01-01
    • 1970-01-01
    • 2020-06-21
    • 1970-01-01
    • 2020-02-11
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    相关资源
    最近更新 更多