File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
src/StronglyTyped.SampleService Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1111 "preLaunchTask" : " build" ,
1212 // If you have changed target frameworks, make sure to update the program path.
1313 "program" : " ${workspaceFolder}/src/StronglyTyped.SampleService/bin/Debug/netcoreapp2.2/StronglyTyped.SampleService.dll" ,
14- "args" : [],
14+ "args" : [" /MySetting:SomeValue=123 " ],
1515 "cwd" : " ${workspaceFolder}/src/StronglyTyped.SampleService" ,
1616 "stopAtEntry" : false ,
1717 "launchBrowser" : {
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public static void Main(string[] args)
1919
2020 public static IWebHostBuilder CreateWebHostBuilder ( string [ ] args ) =>
2121 WebHost . CreateDefaultBuilder ( args )
22- . UseStartup < Startup > ( ) ;
22+ . UseStartup < Startup > ( )
23+ . ConfigureAppConfiguration ( x => { x . AddCommandLine ( args ) ; } ) ;
2324 }
2425}
Original file line number Diff line number Diff line change @@ -15,9 +15,14 @@ namespace StronglyTyped.SampleService
1515{
1616 public class Startup
1717 {
18- public Startup ( IConfiguration configuration )
18+ public Startup ( IConfiguration configuration , IHostingEnvironment environment )
1919 {
20- Configuration = configuration ;
20+ Configuration = new ConfigurationBuilder ( )
21+ . AddJsonFile ( "appsettings.json" )
22+ . AddJsonFile ( $ "appsettings.{ environment . EnvironmentName } ", optional : true )
23+ . AddEnvironmentVariables ( )
24+ . AddConfiguration ( configuration )
25+ . Build ( ) ;
2126 }
2227
2328 public IConfiguration Configuration { get ; }
You can’t perform that action at this time.
0 commit comments