【发布时间】:2022-06-27 11:56:58
【问题描述】:
如何在 ASP.Net Core 6 中配置 AutoMapper
我有一个用 .Net 3.1 编写的项目,所以我们有 Startup.cs 类。
我正在将它迁移到 .net core 6
现在当我将以下配置放入我的 .Net 6 Program.cs 中时
builder.Services.AddAutoMapper(typeof(Startup));
我收到错误,找不到类型或命名空间启动
有什么建议吗?如何在 .net 6 中修复或配置它
【问题讨论】:
-
typeof(Program).Assembly我推荐了this question -
您的评论是正确的,您可以将其发布为答案,以便我接受。
-
非常感谢您的回复先生:)
标签: asp.net-core automapper .net-6.0