.net - “IConfigurationSection”不包含 'Get' 的定义并且没有可访问的扩展名

标签 .net asp.net-mvc .net-core jwt n-tier-architecture

我创建了 JwtHelper 类。我已经使用它很长时间了。但是,当我更新软件包时,以下行出现错误;

Error Lines

完整的错误信息如下;

Severity Code Description Project File Line Suppression State Error CS1061 'IConfigurationSection' does not contain a definition for 'Get' and no accessible extension method 'Get' accepting a first argument of type 'IConfigurationSection' could be found (are you missing a using directive or an assembly reference?)

我找到了解决方案。我写在这里是为了不要浪费时间。

最佳答案

转到 Nuget 并下载“Microsoft.Extensions.Configuration.Binder”包。

enter image description here

Install-Package Microsoft.Extensions.Configuration.Binder -Version 5.0.0

关于.net - “IConfigurationSection”不包含 'Get' 的定义并且没有可访问的扩展名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67019309/

相关文章:

javascript - 如何在 .net 核心应用程序中使用 post 方法将 javascript 值传递给 Controller ​​?

c# - 如何在 Entity Framework Core 中设置实体关系

c# - EasynetQ 总线。订阅未触发 - 抛出 "messageType must not be null"

c# - 自定义 CodeAccessSecurityAttribute

c# - 当我完成 View 和 ViewModel 而不是 Model 时,如何删除事件处理程序

.net - ASP.NET 按钮和覆盖渲染事件

c# - 如何将基类型列表转换为派生类型列表

c# - 在 ASP.NET MVC 中保留用户数据

.net - 解析器错误消息 : Could not load type 'TestMvcApplication.MvcApplication'

c# - 将大文件发布到 REST Endpoint c# .net core