@@ -36,29 +36,37 @@ public sealed class ScriptStartupTypeLocator : IWebJobsStartupTypeLocator
3636 private readonly IExtensionBundleManager _extensionBundleManager ;
3737 private readonly IFunctionMetadataManager _functionMetadataManager ;
3838 private readonly IMetricsLogger _metricsLogger ;
39- private readonly Lazy < IEnumerable < Type > > _startupTypes ;
39+ private readonly IEnvironment _environment ;
4040 private readonly IOptions < ExtensionRequirementOptions > _extensionRequirementOptions ;
41+ private readonly Lazy < IEnumerable < Type > > _startupTypes ;
4142 private static string [ ] _builtinExtensionAssemblies = GetBuiltinExtensionAssemblies ( ) ;
4243
43- public ScriptStartupTypeLocator ( string rootScriptPath , ILogger < ScriptStartupTypeLocator > logger , IExtensionBundleManager extensionBundleManager ,
44- IFunctionMetadataManager functionMetadataManager , IMetricsLogger metricsLogger , IOptions < ExtensionRequirementOptions > extensionRequirementOptions )
44+ public ScriptStartupTypeLocator (
45+ string rootScriptPath ,
46+ ILogger < ScriptStartupTypeLocator > logger ,
47+ IExtensionBundleManager extensionBundleManager ,
48+ IFunctionMetadataManager functionMetadataManager ,
49+ IMetricsLogger metricsLogger ,
50+ IEnvironment environment ,
51+ IOptions < ExtensionRequirementOptions > extensionRequirementOptions )
4552 {
4653 _rootScriptPath = rootScriptPath ?? throw new ArgumentNullException ( nameof ( rootScriptPath ) ) ;
4754 _extensionBundleManager = extensionBundleManager ?? throw new ArgumentNullException ( nameof ( extensionBundleManager ) ) ;
4855 _logger = logger ;
4956 _functionMetadataManager = functionMetadataManager ;
5057 _metricsLogger = metricsLogger ;
51- _startupTypes = new Lazy < IEnumerable < Type > > ( ( ) => GetExtensionsStartupTypesAsync ( ) . ConfigureAwait ( false ) . GetAwaiter ( ) . GetResult ( ) ) ;
58+ _environment = environment ;
5259 _extensionRequirementOptions = extensionRequirementOptions ;
60+ _startupTypes = new Lazy < IEnumerable < Type > > ( ( ) => GetExtensionsStartupTypesAsync ( ) . ConfigureAwait ( false ) . GetAwaiter ( ) . GetResult ( ) ) ;
5361 }
5462
5563 private static string [ ] GetBuiltinExtensionAssemblies ( )
5664 {
57- return new [ ]
58- {
65+ return
66+ [
5967 typeof ( WebJobs . Extensions . Http . HttpWebJobsStartup ) . Assembly . GetName ( ) . Name ,
6068 typeof ( WebJobs . Extensions . ExtensionsWebJobsStartup ) . Assembly . GetName ( ) . Name
61- } ;
69+ ] ;
6270 }
6371
6472 public Type [ ] GetStartupTypes ( )
@@ -102,11 +110,11 @@ public async Task<IEnumerable<Type>> GetExtensionsStartupTypesAsync()
102110 }
103111 }
104112
105- bool isDotnetIsolatedApp = Utility . IsDotnetIsolatedApp ( SystemEnvironment . Instance , functionMetadataCollection ) ;
113+ bool isDotnetIsolatedApp = Utility . IsDotnetIsolatedApp ( _environment , functionMetadataCollection ) ;
106114 bool isDotnetApp = isPrecompiledFunctionApp || isDotnetIsolatedApp ;
107- var isLogicApp = SystemEnvironment . Instance . IsLogicApp ( ) ;
115+ var isLogicApp = _environment . IsLogicApp ( ) ;
108116
109- if ( SystemEnvironment . Instance . IsPlaceholderModeEnabled ( ) )
117+ if ( _environment . IsPlaceholderModeEnabled ( ) )
110118 {
111119 // Do not move this.
112120 // Calling this log statement in the placeholder mode to avoid jitting during specialization
0 commit comments