IConfiguration does not contain a definition for GetValue

前端 未结 1 869
名媛妹妹
名媛妹妹 2021-02-04 23:14

After moving a class through projects, one of the IConfiguration methods, GetValue, stopped working. The usage is like this:



        
相关标签:
1条回答
  • 2021-02-04 23:48

    Just install Microsoft.Extensions.Configuration.Binder and the method will be available.

    The reason is that GetValue<T> is an extension method and does not exist directly in the IConfiguration interface.

    0 讨论(0)
提交回复
热议问题