Search code examples
f#funscript

Namespace or module "Runtime" not defined


So the "Funscript" page here has a sample. Now I have loaded the sample into my Visual Studio 2012. I am not familiar with Visual Studio .NET and am only learning F# very recently. The last line in the sample pages which is:

do Runtime.Run(components=components, directory="Web") 

always throws an error. In fact the Visual Studio IDE(Compiler) cannot seem to recognize Runtime.

If this was a language like Java, one would try to import a library and so I tried using System.Runtime, but still the Visual Studio IDE does not recognize and the line throws an error saying :

"The namespace or module "Runtime" is not defined.

Two questions

  1. How can I get around this?
  2. Is there any link that teaches F# for the complete beginner that also involves loading external libraries?

Solution

  • I figured this out. Funscript requires a launcher, which is talked about in the documentation. It is contained in Examples/Shared/Launcher.fs. If you use the .fsproj files that come with funscript, this is all handled automatically.

    If you are compiling by hand, just add ../Shared/Launcher.fs before you compile your own file.