diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs index 1d030ade87..43f67bc2d3 100644 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs +++ b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs @@ -53,7 +53,7 @@ module TheControl = else let path = Environment.GetEnvironmentVariable("PATH") let paths = path.Split([|';'|]) - let path = paths |> Array.tryfind (fun x -> try File.Exists(Path.Combine(x, "fsi.exe")) with _ -> false) + let path = paths |> Array.tryFind (fun x -> try File.Exists(Path.Combine(x, "fsi.exe")) with _ -> false) match path with | Some x -> fsiProcess.StartInfo.FileName <- Path.Combine(x, "fsi.exe") diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs index f387d4c1bd..06a6b4a049 100644 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs +++ b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs @@ -174,18 +174,19 @@ module ProjectHelpers = doc.Load(project.FileName) let nsmgr = new XmlNamespaceManager(doc.NameTable) nsmgr.AddNamespace("proj", "http://schemas.microsoft.com/developer/msbuild/2003") + let d = new Dictionary() nodes |> forEachFileNode (fun node -> let docNode = doc.SelectSingleNode(Printf.sprintf @"//proj:Compile[@Include=""%s""]" (Path.GetFileName(node.FileName)), nsmgr) - docNode.ParentNode.RemoveChild(docNode) |> ignore) + if docNode <> null then + d.[node] <- docNode + docNode.ParentNode.RemoveChild(docNode) |> ignore) let itemNode = doc.SelectSingleNode("//proj:ItemGroup", nsmgr) nodes |> forEachFileNode (fun node -> - let xmlElem = doc.CreateElement("", "Compile", "http://schemas.microsoft.com/developer/msbuild/2003") - let xmlAttr = doc.CreateAttribute("Include") - xmlAttr.InnerText <- Path.GetFileName(node.FileName) - xmlElem.Attributes.Append(xmlAttr) |> ignore - itemNode.AppendChild(xmlElem) |> ignore) + let found, xmlElem = d.TryGetValue(node) + if found then + itemNode.AppendChild(xmlElem) |> ignore) doc.Save(project.FileName)