Skip to content

Commit 7cfbc1d

Browse files
committed
Initial tactical fix to address fallback logic that triggers load calls in a loop
1 parent 92fd1a6 commit 7cfbc1d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/WebJobs.Script/Description/DotNet/FunctionAssemblyLoadContext.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,20 @@ private Assembly LoadCore(AssemblyName assemblyName)
171171

172172
protected override Assembly Load(AssemblyName assemblyName)
173173
{
174+
if (_sharedContextAssembliesInFallbackLoad.ContainsKey(assemblyName.Name))
175+
{
176+
// Short circuit the probing logic as we're falling back to the original load
177+
// context (from default), so just attempt to load the assembly:
178+
var result = LoadCore(assemblyName);
179+
180+
if (result == null)
181+
{
182+
throw new FileNotFoundException($"Could not load file or assembly '{assemblyName}'. The system cannot find the file specified.");
183+
}
184+
185+
return result;
186+
}
187+
174188
// Try to load from deps references, if available
175189
if (TryLoadDepsDependency(assemblyName, out Assembly assembly))
176190
{

0 commit comments

Comments
 (0)