File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
dev-proxy/CommandHandlers Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ public async Task<int> InvokeAsync(InvocationContext context)
4040 var builder = WebApplication . CreateBuilder ( ) ;
4141 builder . Logging . AddFilter ( "Microsoft.Hosting.*" , LogLevel . Error ) ;
4242 builder . Logging . AddFilter ( "Microsoft.AspNetCore.*" , LogLevel . Error ) ;
43+
44+ // API controller is registered first and so is the last service to be disposed of when the app is shutdown
45+ builder . Services . AddControllers ( ) ;
4346
4447 builder . Services . AddSingleton < IProxyState , ProxyState > ( ) ;
4548 builder . Services . AddSingleton < IProxyConfiguration , ProxyConfiguration > ( sp => ConfigurationFactory . Value ) ;
@@ -48,7 +51,6 @@ public async Task<int> InvokeAsync(InvocationContext context)
4851 builder . Services . AddSingleton ( _urlsToWatch ) ;
4952 builder . Services . AddHostedService < ProxyEngine > ( ) ;
5053
51- builder . Services . AddControllers ( ) ;
5254 builder . Services . AddEndpointsApiExplorer ( ) ;
5355 builder . Services . AddSwaggerGen ( ) ;
5456
You can’t perform that action at this time.
0 commit comments