@@ -21,7 +21,7 @@ internal sealed class HostFactoryResolver
21
21
public const string CreateHostBuilder = nameof ( CreateHostBuilder ) ;
22
22
23
23
// The amount of time we wait for the diagnostic source events to fire
24
- private static readonly TimeSpan s_defaultWaitTimeout = TimeSpan . FromSeconds ( 5 ) ;
24
+ private static readonly TimeSpan s_defaultWaitTimeout = Debugger . IsAttached ? Timeout . InfiniteTimeSpan : TimeSpan . FromSeconds ( 5 ) ;
25
25
26
26
public static Func < string [ ] , TWebHost > ? ResolveWebHostFactory < TWebHost > ( Assembly assembly )
27
27
{
@@ -44,10 +44,10 @@ internal sealed class HostFactoryResolver
44
44
// 3. Give the caller a chance to execute logic to mutate the IHostBuilder
45
45
// 4. Resolve the instance of the applications's IHost
46
46
// 5. Allow the caller to determine if the entry point has completed
47
- public static Func < string [ ] , object > ? ResolveHostFactory ( Assembly assembly ,
48
- TimeSpan ? waitTimeout = null ,
49
- bool stopApplication = true ,
50
- Action < object > ? configureHostBuilder = null ,
47
+ public static Func < string [ ] , object > ? ResolveHostFactory ( Assembly assembly ,
48
+ TimeSpan ? waitTimeout = null ,
49
+ bool stopApplication = true ,
50
+ Action < object > ? configureHostBuilder = null ,
51
51
Action < Exception ? > ? entrypointCompleted = null )
52
52
{
53
53
if ( assembly . EntryPoint is null )
@@ -64,7 +64,7 @@ internal sealed class HostFactoryResolver
64
64
{
65
65
return null ;
66
66
}
67
-
67
+
68
68
// We're using a version >= 6 so the events can fire. If they don't fire
69
69
// then it's because the application isn't using the hosting APIs
70
70
}
@@ -178,8 +178,8 @@ private sealed class HostingListener : IObserver<DiagnosticListener>, IObserver<
178
178
179
179
private readonly TaskCompletionSource < object > _hostTcs = new ( ) ;
180
180
private IDisposable ? _disposable ;
181
- private Action < object > ? _configure ;
182
- private Action < Exception ? > ? _entrypointCompleted ;
181
+ private readonly Action < object > ? _configure ;
182
+ private readonly Action < Exception ? > ? _entrypointCompleted ;
183
183
private static readonly AsyncLocal < HostingListener > _currentListener = new ( ) ;
184
184
185
185
public HostingListener ( string [ ] args , MethodInfo entryPoint , TimeSpan waitTimeout , bool stopApplication , Action < object > ? configure , Action < Exception ? > ? entrypointCompleted )
0 commit comments