var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json");
var configuration = builder.Build();
string baseUrl = configuration.GetSection("baseUrl").Value;

appsettings.json

{
  "baseUrl": "http://duyaonet.com"
}

解决办法 

appsettings.json的属性   复制到输出目录: 始终复制

解决办法 

appsettings.json的属性   复制到输出目录: 始终复制

相关文章:

  • 2021-10-10
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-21
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
相关资源
相似解决方案