If InstallFSharp.msi failed you can try a manual install by simply running alternative-install-vs2005.bat. Indeed, you can always use this technique if you wish, but there will be no uninstall option. If this fails see the troubleshooting section below.
If you have Visual Studio 2003, you must do a manual install by simply running alternative-install-vs2003.bat. There is no uninstall option when using this technique, though you can always upgrade an installation simply by re-registering (in truth you can uninstall by just running the regsvr32 /u uninstallation commands that reverse the registrations done in the batch file).
When installing for Visual Studio 2003 you should ensure your machine is up-to-date with latest service packs and updates from Microsoft. You may also need to install the Microsoft Visual C++ 2005 runtime redistributable. Some people have reported problems running InstallFsharp.msi when installing for Visual Studio 2003 when registering DLL such as fslangservice.dll, in which case you can ignore these errors and register these DLLs using alternative-install-vs2003.bat. After doing this you should run devenv /setup, if this has not been done automatically by alternative-install-vs2003.bat.
Here are the known issues in F# for Visual Studio, which you should read before making serious use of the system.
The Visual Studio Debugger will work with F# code without any additional installation steps. Debugging information for the libraries may be found in the bin directory. In Visual Studio 2005 you may need to disable “Just My Code” debugging (use the “Options” menu). You can also set the appropriate symbol path there or you can add that path to the _NT_SYMBOL_PATH environment variable.
The F# compiler produces PDB files directly, including for optimized code. These enable debugging either within Visual Studio or with other dedicated debuggers such as dbgclr.exe or cordbg.exe.
Debugging with F# for Visual Studio 2003/2005
If you are using the “F# for Visual Studio” plug-in for your F# projects you can launch debugging sessions directly from the environment. This is as simple as creating an “F# Project”, populating it with your code, pressing F11 to “step into” your program, and then you’re away!
Using Another Editor? You can still debug using Visual Studio 2003/2005!
All versions of Microsoft Visual Studio can be used as debuggers, regardless of whether you have created an F# project or even if you don’t have the F# Visual Studio plug-in installed at all (e.g., you are using the command-line compiler and Makefiles). There are five ways to start a debugging session. In all cases you should compile your code with the -g option to generate debug symbols.
Tips. If debug symbols are not found for your code or for the F# library then you will probably want to disable “Just My Code” debugging in the “Options” menu (Visual Studio 2005 only). You can also set the _NT_SYMBOL_PATH variable globally on your machine.
Debugging with DBGCLR.EXE
The .NET Framework SDK comes with an excellent lightweight graphical debugger. To use this simply compile your code with the -g, make sure dbgclr.exe is on your path and then run it, e.g.,
Using Visual C# 2005 Express and Friends
Visual C# 2005 Express, Visual Basic 2005 Express and some similar products are no-cost downloads from Microsoft site, and can all be used with F# code, or with multi-language programs. To use them with F#, open a console project and set the properties on the project to indicate the F# program to run.
This is the command-line debug shell from the .NET Framework SDK, and can be used with F# code. e.g.,
C:devsrccode>cordbg (cordbg) run cdebug.exe (cordbg) help (cordbg) show 20 (cordbg) si (cordbg) si (cordbg) si (cordbg) w
F# uses the compilation facilities of the .NET CLR to generate high performance native code via the Common IL intermediary form. F# has the succinctness of a scripting language, and yet static type-checking and type-inference ensure that compact data representations are used and high performance efficient code is generated for all language constructs.
This page gives further tips on improving the performance of your F# code.
Optimizing your code
Faster code is produced by using the cross module optimizer (the “-O” options).