Skip to content

Commit

Permalink
Fix #504 (FSharp.Core in MSBuild) for Clean target
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Dec 9, 2015
1 parent 7f7fe5d commit cdda2b6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/compiler/WebSharper.MSBuild/WebSharperTask.fs
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,14 @@ 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")
// Force loading the right FSharp.Core.dll.
this.ItemInput
|> Array.tryFind (fun x ->
Path.GetFileNameWithoutExtension(x.ItemSpec)
.ToLowerInvariant() = "fsharp.core")
|> Option.iter (fun fscore ->
ad.CreateInstanceFrom(fscore.ItemSpec, typeof<StructAttribute>.FullName)
|> ignore)
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 cdda2b6

Please sign in to comment.