1919using Microsoft . CodeAnalysis . CSharp ;
2020using Microsoft . CodeAnalysis . CSharp . Scripting ;
2121using Microsoft . CodeAnalysis . Scripting ;
22+ using Microsoft . CodeAnalysis . Scripting . Hosting ;
2223
2324namespace Microsoft . Azure . WebJobs . Script . Description
2425{
@@ -42,6 +43,9 @@ public class CSharpFunctionInvoker : ScriptFunctionInvokerBase
4243 private Action < MethodInfo , object [ ] , object > _resultProcessor ;
4344 private FunctionValueLoader _functionValueLoader ;
4445
46+ private static readonly Lazy < InteractiveAssemblyLoader > AssemblyLoader
47+ = new Lazy < InteractiveAssemblyLoader > ( ( ) => new InteractiveAssemblyLoader ( ) , LazyThreadSafetyMode . ExecutionAndPublication ) ;
48+
4549 private static readonly string [ ] WatchedFileTypes = { ".cs" , ".csx" , ".dll" , ".exe" } ;
4650
4751 internal CSharpFunctionInvoker ( ScriptHost host , FunctionMetadata functionMetadata ,
@@ -407,7 +411,7 @@ private Compilation GetScriptCompilation(Script<object> script, bool debug)
407411 private Script < object > CreateScript ( )
408412 {
409413 string code = GetFunctionSource ( ) ;
410- return CSharpScript . Create ( code , options : _metadataResolver . FunctionScriptOptions ) ;
414+ return CSharpScript . Create ( code , options : _metadataResolver . FunctionScriptOptions , assemblyLoader : AssemblyLoader . Value ) ;
411415 }
412416
413417 private static object GetTaskResult ( Task task )
0 commit comments