1、dotnet core 默认不支持 ConfigurationManager ,需要单独应用。
nuget System.Configuration.ConfigurationManager
2、使用
ConfigurationManager.ConnectionStrings["xxxxx"].ConnectionString
ConfigurationManager.AppSettings["xxxx"]
参考:
https://docs.microsoft.com/zh-cn/ef/core/miscellaneous/connection-strings