OcelotDemo
OcelotDemo copied to clipboard
配置自动查找并合并配置文件到ocelot.json文件中代码run wrong
我的ocelot版本是12.0.1 那么program.cs文件中应该为:
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .ConfigureAppConfiguration((hostingContext, config) => { config .SetBasePath(hostingContext.HostingEnvironment.ContentRootPath) .AddJsonFile("appsettings.json", true, true) .AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true) .AddOcelot(hostingContext.HostingEnvironment) .AddEnvironmentVariables(); }) .UseStartup<Startup>();