19
19
using Microsoft . CodeAnalysis . CSharp ;
20
20
using Microsoft . CodeAnalysis . CSharp . Scripting ;
21
21
using Microsoft . CodeAnalysis . Scripting ;
22
+ using Microsoft . CodeAnalysis . Scripting . Hosting ;
22
23
23
24
namespace Microsoft . Azure . WebJobs . Script . Description
24
25
{
@@ -42,6 +43,9 @@ public class CSharpFunctionInvoker : ScriptFunctionInvokerBase
42
43
private Action < MethodInfo , object [ ] , object > _resultProcessor ;
43
44
private FunctionValueLoader _functionValueLoader ;
44
45
46
+ private static readonly Lazy < InteractiveAssemblyLoader > AssemblyLoader
47
+ = new Lazy < InteractiveAssemblyLoader > ( ( ) => new InteractiveAssemblyLoader ( ) , LazyThreadSafetyMode . ExecutionAndPublication ) ;
48
+
45
49
private static readonly string [ ] WatchedFileTypes = { ".cs" , ".csx" , ".dll" , ".exe" } ;
46
50
47
51
internal CSharpFunctionInvoker ( ScriptHost host , FunctionMetadata functionMetadata ,
@@ -407,7 +411,7 @@ private Compilation GetScriptCompilation(Script<object> script, bool debug)
407
411
private Script < object > CreateScript ( )
408
412
{
409
413
string code = GetFunctionSource ( ) ;
410
- return CSharpScript . Create ( code , options : _metadataResolver . FunctionScriptOptions ) ;
414
+ return CSharpScript . Create ( code , options : _metadataResolver . FunctionScriptOptions , assemblyLoader : AssemblyLoader . Value ) ;
411
415
}
412
416
413
417
private static object GetTaskResult ( Task task )
0 commit comments