This repository was archived by the owner on Nov 29, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
samples/LocalizationSample Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88using Microsoft . AspNetCore . Hosting ;
99using Microsoft . AspNetCore . Http ;
1010using Microsoft . AspNetCore . Localization ;
11+ using Microsoft . Extensions . Configuration ;
1112using Microsoft . Extensions . DependencyInjection ;
1213using Microsoft . Extensions . Localization ;
1314using Microsoft . Extensions . PlatformAbstractions ;
@@ -154,9 +155,11 @@ private static async System.Threading.Tasks.Task WriteCultureSelectOptions(HttpC
154155
155156 public static void Main ( string [ ] args )
156157 {
158+ var config = new ConfigurationBuilder ( ) . AddCommandLine ( args ) . Build ( ) ;
159+
157160 var host = new WebHostBuilder ( )
158- . UseDefaultHostingConfiguration ( args )
159161 . UseKestrel ( )
162+ . UseConfiguration ( config )
160163 . UseIISIntegration ( )
161164 . UseStartup < Startup > ( )
162165 . Build ( ) ;
Original file line number Diff line number Diff line change 44 "Microsoft.NETCore.Platforms" : " 1.0.1-*" ,
55 "Microsoft.AspNetCore.Server.IISIntegration" : " 1.0.0-*" ,
66 "Microsoft.AspNetCore.Localization" : " 1.0.0-*" ,
7+ "Microsoft.Extensions.Configuration.CommandLine" : " 1.0.0-*" ,
78 "Microsoft.Extensions.Localization" : " 1.0.0-*" ,
89 "Microsoft.AspNetCore.Server.Kestrel" : " 1.0.0-*"
910 },
Original file line number Diff line number Diff line change 22// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
44using Microsoft . AspNetCore . Hosting ;
5+ using Microsoft . Extensions . Configuration ;
56
67namespace LocalizationWebsite
78{
89 public static class Program
910 {
1011 public static void Main ( string [ ] args )
1112 {
13+ var config = new ConfigurationBuilder ( )
14+ . AddCommandLine ( args )
15+ . AddEnvironmentVariables ( prefix : "ASPNETCORE_" )
16+ . Build ( ) ;
17+
1218 var host = new WebHostBuilder ( )
1319 . UseKestrel ( )
14- . UseDefaultHostingConfiguration ( args )
20+ . UseConfiguration ( config )
1521 . UseStartup ( "LocalizationWebsite" )
1622 . Build ( ) ;
1723
Original file line number Diff line number Diff line change 88 "Microsoft.NETCore.Platforms" : " 1.0.1-*" ,
99 "Microsoft.AspNetCore.Localization" : " 1.0.0-*" ,
1010 "Microsoft.AspNetCore.Server.Kestrel" : " 1.0.0-*" ,
11+ "Microsoft.Extensions.Configuration.CommandLine" : " 1.0.0-*" ,
1112 "Microsoft.Extensions.Localization" : " 1.0.0-*" ,
1213 "Microsoft.Extensions.Logging.Console" : " 1.0.0-*"
1314 },
You can’t perform that action at this time.
0 commit comments