Skip to content

Commit 802e6e7

Browse files
committed
Explicit error when cracker exe is missing
The ProjectCracker exe must be adjacent to the dll for it to shell to. When it's not an unclear Win32Exception is given. This explicitly checks and says what file is missing.
1 parent 81eb5b7 commit 802e6e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/fsharp/FSharp.Compiler.Service.ProjectCracker/ProjectCracker.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ type ProjectCracker =
4848
arguments.Append(' ').Append(k).Append(' ').Append(v) |> ignore
4949
let codebase = Path.GetDirectoryName(Uri(typeof<ProjectCracker>.Assembly.CodeBase).LocalPath)
5050

51+
let crackerFilename = Path.Combine(codebase,"FSharp.Compiler.Service.ProjectCrackerTool.exe")
52+
if not (File.Exists crackerFilename) then failwithf "ProjectCracker exe not found at: %s it must be next to the ProjectCracker dll." crackerFilename
5153
let p = new System.Diagnostics.Process()
52-
p.StartInfo.FileName <- Path.Combine(codebase,"FSharp.Compiler.Service.ProjectCrackerTool.exe")
54+
p.StartInfo.FileName <- crackerFilename
5355
p.StartInfo.Arguments <- arguments.ToString()
5456
p.StartInfo.UseShellExecute <- false
5557
p.StartInfo.CreateNoWindow <- true

0 commit comments

Comments
 (0)