File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 66using DevProxy . Commands ;
77using System . Net ;
88
9- static WebApplication BuildApplication ( string [ ] args , DevProxyConfigOptions options )
9+ static WebApplication BuildApplication ( DevProxyConfigOptions options )
1010{
11- var builder = WebApplication . CreateBuilder ( args ) ;
11+ // Don't pass command-line args to WebApplication.CreateBuilder because:
12+ // 1. Dev Proxy uses System.CommandLine for CLI parsing, not ASP.NET Core's CommandLineConfigurationProvider
13+ // 2. ConfigureDevProxyConfig clears all configuration sources anyway and only uses JSON config files
14+ var builder = WebApplication . CreateBuilder ( ) ;
1215
1316 _ = builder . Configuration . ConfigureDevProxyConfig ( options ) ;
1417 _ = builder . Logging . ConfigureDevProxyLogging ( builder . Configuration , options ) ;
@@ -36,7 +39,7 @@ static WebApplication BuildApplication(string[] args, DevProxyConfigOptions opti
3639
3740var options = new DevProxyConfigOptions ( ) ;
3841options . ParseOptions ( args ) ;
39- var app = BuildApplication ( args , options ) ;
42+ var app = BuildApplication ( options ) ;
4043
4144var devProxyCommand = app . Services . GetRequiredService < DevProxyCommand > ( ) ;
4245var loggerFactory = app . Services . GetRequiredService < ILoggerFactory > ( ) ;
You can’t perform that action at this time.
0 commit comments