@@ -81,6 +81,7 @@ public async Task<IEnumerable<Type>> GetExtensionsStartupTypesAsync()
8181 var bundleConfigured = _extensionBundleManager . IsExtensionBundleConfigured ( ) ;
8282 bool isLegacyExtensionBundle = _extensionBundleManager . IsLegacyExtensionBundle ( ) ;
8383 bool isPrecompiledFunctionApp = false ;
84+ bool isDotnetIsolatedApp = false ;
8485
8586 // dotnet app precompiled -> Do not use bundles
8687 var workerConfigs = _languageWorkerOptions . CurrentValue . WorkerConfigs ;
@@ -101,9 +102,10 @@ public async Task<IEnumerable<Type>> GetExtensionsStartupTypesAsync()
101102 }
102103 isPrecompiledFunctionApp = isPrecompiledFunctionApp || functionMetadata . Language == DotNetScriptTypes . DotNetAssembly ;
103104 }
105+
106+ isDotnetIsolatedApp = IsDotnetIsolatedApp ( functionMetadataCollection , SystemEnvironment . Instance ) ;
104107 }
105108
106- bool isDotnetIsolatedApp = IsDotnetIsolatedApp ( workerConfigs ) ;
107109 bool isDotnetApp = isPrecompiledFunctionApp || isDotnetIsolatedApp ;
108110 var isLogicApp = SystemEnvironment . Instance . IsLogicApp ( ) ;
109111
@@ -335,14 +337,10 @@ void CollectError(Type extensionType, Version minimumVersion, ExtensionStartupTy
335337 }
336338 }
337339
338- private bool IsDotnetIsolatedApp ( IList < RpcWorkerConfig > workerConfigs )
340+ private bool IsDotnetIsolatedApp ( IEnumerable < FunctionMetadata > functions , IEnvironment environment )
339341 {
340- if ( workerConfigs != null )
341- {
342- return workerConfigs . Where ( config => config . Description is not null && config . Description . Language == RpcWorkerConstants . DotNetIsolatedLanguageWorkerName ) . Any ( ) ;
343- }
344-
345- return false ;
342+ string workerRuntime = Utility . GetWorkerRuntime ( functions , environment ) ;
343+ return workerRuntime . Equals ( RpcWorkerConstants . DotNetIsolatedLanguageWorkerName , StringComparison . OrdinalIgnoreCase ) ;
346344 }
347345
348346 private class TypeNameEqualityComparer : IEqualityComparer < Type >
0 commit comments