How to keep fsi.exe open after startup

I have a bunch of F # (fsx) scripts that I use for my basic deployment needs. I just right-clicked and said: "Run using F # interactive"

However, sometimes the script fails, and I would like the interactive console to work. So far I have not understood a good way to achieve this.

I tried to run the fsi.exe file manually, but how can I run the script there?

+5
source share
3 answers

If you're hacky enough, you might need to add another explorer context menu item, similar to Run with F# Interactive, but keeping the console window open after the .fsxscript completes . Here is a work plan on how to achieve this for Windows7 / VS2012:

  • is an open administrator regeditand find the keyHKEY_CLASSES_ROOT\VisualStudio.fsx.11.0\shell
  • add a new subsection with some unique name, for example openRunCmd, make a (Default)value for this key, what would you like to see in the context menu, perhapsRun with Fsi in shell
  • finally add a subsection HKEY_CLASSES_ROOT\VisualStudio.fsx.11.0\shell\openRunCmd\commandand set the value of this value to the value (Default)for the following line:

    c:\windows\system32\cmd.exe /Q /K %%USERPROFILE%%\fsx.bat "%1"

Now close regedit, go to your home directory and create a batch file fsx.batwith the following line:

"C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0\Fsi.exe" --quiet --exec "%1"

.fsx script , Run with Fsi in shell script . VS2010.

, . !

. , , .

+9
#load "myScipt.fsx";;

, . (cmd.exe), fsi myScipt.fsx .

+3

Windows

:

cmd /k "C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\Fsi.exe" deploy.fsx

:

C:\FolderContaningFsxScript

, script , . , script, .

It’s easier for me to simply click the shortcut, rather than right-click> Run with F # Interactive. I think the batch file with the specified command will work.

0
source

All Articles