File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -562,7 +562,7 @@ private void VerifyPrecompileStatus(IEnumerable<FunctionDescriptor> functions)
562
562
/// Get the set of types that should be directly loaded. These have the "configurationSource" : "attributes" set.
563
563
/// They will be indexed and invoked directly by the WebJobs SDK and skip the IL generator and invoker paths.
564
564
/// </summary>
565
- private static IEnumerable < Type > GetDirectTypes ( IEnumerable < FunctionMetadata > functionMetadataList )
565
+ private IEnumerable < Type > GetDirectTypes ( IEnumerable < FunctionMetadata > functionMetadataList )
566
566
{
567
567
HashSet < Type > visitedTypes = new HashSet < Type > ( ) ;
568
568
@@ -578,8 +578,17 @@ private static IEnumerable<Type> GetDirectTypes(IEnumerable<FunctionMetadata> fu
578
578
579
579
Assembly assembly = Assembly . LoadFrom ( path ) ;
580
580
var type = assembly . GetType ( typeName ) ;
581
-
582
- visitedTypes . Add ( type ) ;
581
+ if ( type != null )
582
+ {
583
+ visitedTypes . Add ( type ) ;
584
+ }
585
+ else
586
+ {
587
+ // This likely means the function.json and dlls are out of sync. Perhaps a badly generated function.json?
588
+ string msg = $ "Failed to load type '{ typeName } ' from '{ path } '";
589
+ TraceWriter . Warning ( msg ) ;
590
+ _startupLogger ? . LogWarning ( msg ) ;
591
+ }
583
592
}
584
593
return visitedTypes ;
585
594
}
You can’t perform that action at this time.
0 commit comments