11namespace Microsoft.FSharp.Compiler.SourceCodeServices
22
3+ open System.Runtime .Serialization .Json
4+ open System.Runtime
35open System.Diagnostics
46open System.Text
57open System.IO
68open System
7- open System.Runtime
89
910type ProjectCracker =
1011
@@ -14,7 +15,7 @@ type ProjectCracker =
1415 let enableLogging = defaultArg enableLogging true
1516 let logMap = ref Map.empty
1617
17- let rec convert ( opts : Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCracker.Tool .ProjectOptions ) : FSharpProjectOptions =
18+ let rec convert ( opts : Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool .ProjectOptions ) : FSharpProjectOptions =
1819 let referencedProjects = Array.map ( fun ( a , b ) -> a, convert b) opts.ReferencedProjectOptions
1920 logMap := Map.add opts.ProjectFile opts.LogOutput ! logMap
2021 { ProjectFileName = opts.ProjectFile
@@ -34,16 +35,15 @@ type ProjectCracker =
3435 let codebase = Path.GetDirectoryName( Uri( typeof< ProjectCracker>. Assembly.CodeBase) .LocalPath)
3536
3637 let p = new System.Diagnostics.Process()
37- p.StartInfo.FileName <- Path.Combine( codebase, " FSharp.Compiler.Service.ProjectCracker.Tool .exe" )
38+ p.StartInfo.FileName <- Path.Combine( codebase, " FSharp.Compiler.Service.ProjectCrackerTool .exe" )
3839 p.StartInfo.Arguments <- arguments.ToString()
3940 p.StartInfo.UseShellExecute <- false
4041 p.StartInfo.CreateNoWindow <- true
4142 p.StartInfo.RedirectStandardOutput <- true
4243 ignore <| p.Start()
4344
44- let fmt = new Serialization.Formatters.Binary.BinaryFormatter()
45- let opts = fmt.Deserialize( p.StandardOutput.BaseStream) :?> Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCracker.Tool.ProjectOptions
46- p.WaitForExit()
45+ let ser = new System.Runtime.Serialization.Json.DataContractJsonSerializer( typeof< Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.ProjectOptions>)
46+ let opts = ser.ReadObject( p.StandardOutput.BaseStream) :?> Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.ProjectOptions
4747
4848 convert opts, ! logMap
4949
0 commit comments