@@ -92,13 +92,19 @@ static async Task Main(string[] args)
9292 . SetMinimumLevel ( LogLevel . Debug ) ) ;
9393
9494 globalServices . AddGlobalTelemetry ( ) ; // Global telemetry services (Singleton)
95+ globalServices . AddSingleton < IIdeChannel , IdeChannelServer > ( ) ;
9596
9697#pragma warning disable ASP0000 // Do not call ConfigureServices after calling UseKestrel.
9798 var globalServiceProvider = globalServices . BuildServiceProvider ( ) ;
9899#pragma warning restore ASP0000
99100
100101 telemetry = globalServiceProvider . GetRequiredService < ITelemetry > ( ) ;
101102
103+ // Force resolution of the IDEChannel to enable connection (Note: We should use a BackgroundService instead)
104+ // Note: The IDE channel is expected to inform IDE that we are up as soon as possible.
105+ // This is required for UDEI to **not** log invalid timeout message.
106+ globalServiceProvider . GetService < IIdeChannel > ( ) ;
107+
102108#pragma warning disable ASPDEPR004
103109 // WebHostBuilder is deprecated in .NET 10 RC1.
104110 // As we still build for .NET 9, ignore this warning until $(NetPrevious)=net10.
@@ -121,7 +127,7 @@ static async Task Main(string[] args)
121127 } )
122128 . ConfigureServices ( services =>
123129 {
124- services . AddSingleton < IIdeChannel , IdeChannelServer > ( ) ;
130+ services . AddSingleton < IIdeChannel > ( _ => globalServiceProvider . GetRequiredService < IIdeChannel > ( ) ) ;
125131 services . AddSingleton < UnoDevEnvironmentService > ( ) ;
126132
127133 // Add the global service provider to the DI container
@@ -151,8 +157,6 @@ static async Task Main(string[] args)
151157 // Once the app has started, we use the logger from the host
152158 Uno . Extensions . LogExtensionPoint . AmbientLoggerFactory = host . Services . GetRequiredService < ILoggerFactory > ( ) ;
153159
154- // Force resolution of the IDEChannel to enable connection (Note: We should use a BackgroundService instead)
155- host . Services . GetService < IIdeChannel > ( ) ;
156160 _ = host . Services . GetRequiredService < UnoDevEnvironmentService > ( ) . StartAsync ( ct . Token ) ; // Background services are not supported by WebHostBuilder
157161
158162 // Display DevServer version banner
0 commit comments