zoukankan      html  css  js  c++  java
  • The configuration file 'appsettings.json' was not found and is not optional

    问:
    .Net Core: Application startup exception: System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional.
     
    答:
    问题代码:
    public Startup()
    {
    var builder = new ConfigurationBuilder().AddJsonFile("AppSetting.json");
    Configuration = builder.Build();
    }
     
     
    正确代码:
    public Startup(IHostingEnvironment environment)
    {
    var builder = new ConfigurationBuilder().SetBasePath(environment.ContentRootPath).AddJsonFile("AppSetting.json");
    Configuration = builder.Build();
    }
  • 相关阅读:
    Analog power pin UPF defination
    动态功耗计算
    静态功耗 计算
    Innovus 对multibit 的支持
    P &R 12
    P & R 11
    power-plan如何定
    P & R 10
    P & R 9
    线程基础
  • 原文地址:https://www.cnblogs.com/icebutterfly/p/6797099.html
Copyright © 2011-2022 走看看