From cdda2b6a1342b706c29bd2771fe8013450120ebe Mon Sep 17 00:00:00 2001 From: Loic Denuziere Date: Wed, 9 Dec 2015 10:25:55 +0100 Subject: [PATCH] Fix #504 (FSharp.Core in MSBuild) for Clean target --- src/compiler/WebSharper.MSBuild/WebSharperTask.fs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/compiler/WebSharper.MSBuild/WebSharperTask.fs b/src/compiler/WebSharper.MSBuild/WebSharperTask.fs index 050399274..a9edaf3a3 100644 --- a/src/compiler/WebSharper.MSBuild/WebSharperTask.fs +++ b/src/compiler/WebSharper.MSBuild/WebSharperTask.fs @@ -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.FullName) + |> ignore) let t = ad.CreateInstanceFromAndUnwrap(loc, typeof.FullName, false, BindingFlags.CreateInstance, null, [||], null, null) :?> Settings t, Some ad let res = this.DoExecute settings