我是.NET的新手,我决定解决.NET Core而不是学习"老方法".我在这里找到了一篇关于为.NET Core设置AutoMapper的详细文章,但新手有更简单的演练吗?
你能解释一下C#或.NET中的程序集是什么吗?
在我的 nugent 面板中,我安装了
AutoMapper v7.0.1 AutoMapper.extensions.microsoft.dependencyinjection v5.0.1
在我的 Startup.cs 中,
我添加了
Services.AddAutoMapper();
但编译器给出
Severity Code Description Project File Line Suppression State
Error CS1061 'IServiceCollection' does not contain a definition for 'AddAutoMapper' and no accessible extension method 'AddAutoMapper' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) OPEApiService J:\Projects\OPEApiService\OPEApiService\Startup.cs 58 Active
Run Code Online (Sandbox Code Playgroud)
我尝试清理、重建、关闭并重新打开 VS。
任何帮助表示赞赏。
谢谢