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)
562562 /// Get the set of types that should be directly loaded. These have the "configurationSource" : "attributes" set.
563563 /// They will be indexed and invoked directly by the WebJobs SDK and skip the IL generator and invoker paths.
564564 /// </summary>
565- private static IEnumerable < Type > GetDirectTypes ( IEnumerable < FunctionMetadata > functionMetadataList )
565+ private IEnumerable < Type > GetDirectTypes ( IEnumerable < FunctionMetadata > functionMetadataList )
566566 {
567567 HashSet < Type > visitedTypes = new HashSet < Type > ( ) ;
568568
@@ -578,8 +578,17 @@ private static IEnumerable<Type> GetDirectTypes(IEnumerable<FunctionMetadata> fu
578578
579579 Assembly assembly = Assembly . LoadFrom ( path ) ;
580580 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+ }
583592 }
584593 return visitedTypes ;
585594 }
You can’t perform that action at this time.
0 commit comments