@@ -962,6 +962,8 @@ type internal FsiDynamicCompiler
962962 let outfile = " TMPFSCI.exe"
963963 let assemblyName = " FSI-ASSEMBLY"
964964
965+ let assemblyReferenceAddedEvent = Control.Event< string>()
966+
965967 let mutable fragmentId = 0
966968 let mutable prevIt : ValRef option = None
967969
@@ -1245,7 +1247,7 @@ type internal FsiDynamicCompiler
12451247 let tcState = istate.tcState
12461248 let tcEnv ,( _dllinfos , ccuinfos ) =
12471249 try
1248- RequireDLL ( ctok, tcImports, tcState.TcEnvFromImpls, assemblyName, m, path)
1250+ RequireDLL ( ctok, tcImports, tcState.TcEnvFromImpls, assemblyName, m, path, assemblyReferenceAddedEvent.Trigger )
12491251 with e ->
12501252 tcConfigB.RemoveReferencedAssemblyByPath( m, path)
12511253 reraise()
@@ -1334,6 +1336,8 @@ type internal FsiDynamicCompiler
13341336 member __.FormatValue ( obj : obj , objTy ) =
13351337 valuePrinter.FormatValue( obj, objTy)
13361338
1339+ member __.AssemblyReferenceAdded = assemblyReferenceAddedEvent.Publish
1340+
13371341//----------------------------------------------------------------------------
13381342// ctrl-c handling
13391343//----------------------------------------------------------------------------
@@ -2640,6 +2644,9 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
26402644 fsiInteractionProcessor.EvalScript( ctok, scriptPath, errorLogger)
26412645 |> commitResultNonThrowing errorOptions scriptPath errorLogger
26422646 |> function Choice1Of2 (_), errs -> Choice1Of2 (), errs | Choice2Of2 exn, errs -> Choice2Of2 exn, errs
2647+
2648+ /// Event fires every time an assembly reference is added to the execution environment, e.g., via `#r`.
2649+ member __.AssemblyReferenceAdded = fsiDynamicCompiler.AssemblyReferenceAdded
26432650
26442651 /// Performs these steps:
26452652 /// - Load the dummy interaction, if any
0 commit comments