Skip to content

Instantly share code, notes, and snippets.

@davidfowl
Last active August 29, 2015 14:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save davidfowl/413a522d3858eec4be39 to your computer and use it in GitHub Desktop.
LoadContext strikes again
A (project) -> B (package)
(build)-> CustomCompiler (project) (build)-> FSharpCompiler (project) -> System.Runtime (package)
public interface ILoadContextProvider {
IAssemblyLoadContext GetLoadContext(Project project, FrameworkName targetFramework);
}
var loadContextProvider = ...
Compile(A)
var compiler = GetCompiler(A)
var blc = loadContextProvider.GetLoadContext(A, framework)
blc.Load(CustomCompiler)
var compiler = GetCompiler(CustomCompiler)
var blc2 = loadContextProvider.GetLoadContext(CustomCompiler, framework)
blc2.Load(FSharpCompiler)
var compiler = GetCompiler(FSharpCompiler)
var blc3 = loadContextProvider.GetLoadContext(FSharpCompiler, framework)
blc3.Load(Microsoft.Dnx.Compilation.CSharp)
blc3.Load(System.Runtime)
var a = compiler.Compile(A, GetReferences(A))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment