Skip to content

Commit

Permalink
Fix #504: MSbuild: force load FSharp.Core in the appdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Dec 8, 2015
1 parent 6e2436c commit 5d68ce1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/compiler/WebSharper.MSBuild/WebSharperTask.fs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,13 @@ type WebSharperTask() =
let dir = Path.GetDirectoryName(loc)
let setup = AppDomainSetup(ConfigurationFile = Path.Combine(dir, config))
let ad = AppDomain.CreateDomain("WebSharperBuild", null, setup)
let proxy =
// Force loading the right FSharp.Core.dll.
let fscore =
this.ItemInput |> Array.find (fun x ->
Path.GetFileNameWithoutExtension(x.ItemSpec)
.ToLowerInvariant() = "fsharp.core")
ad.CreateInstanceFrom(fscore.ItemSpec, typeof<StructAttribute>.FullName)
let t = ad.CreateInstanceFromAndUnwrap(loc, typeof<Settings>.FullName, false, BindingFlags.CreateInstance, null, [||], null, null) :?> Settings
t, Some ad
let res = this.DoExecute settings
Expand Down

0 comments on commit 5d68ce1

Please sign in to comment.