【发布时间】:2021-02-08 18:25:49
【问题描述】:
严重性代码描述项目文件行抑制状态 错误 CS1061 'IServiceCollection' 不包含 'AddDefaultIdentity' 并且没有可访问的扩展方法 'AddDefaultIdentity' 接受类型的第一个参数 可以找到“IServiceCollection”(您是否缺少 using 指令 或大会 参考?)WebHesab C:\Users\DELL\source\repos\WebHesab\WebHesab\Startup.cs 36 Active
【问题讨论】:
-
复制并粘贴此处的代码...然后确保您具有实体框架工作的 nuget 包标识...
-
您的 IServiceCollection 是否与调用的 ServiceCollection 类匹配?确保 IServiceCollection 中提到了 ServiceCollection 类的所有公共函数
-
把
using Microsoft.Extensions.DependencyInjection;放在你的startup.cs的顶部如果你右击红色下划线,它会告诉你如何修复它,甚至为你做。
标签: c# asp.net asp.net-mvc asp.net-core .net-core