7
votes

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?
1
The tutorial here: funscript.info/samples/tutorial.html talks about how to add references to the dlls required.John Palmer
I did go through the tutorial and I have added all the dlls. The three dlls mentioned. Any other pointers? In fact I tried looking for references to Runtime and I am unable to find such an error anywhere here in stackoverflow. I do see that the reference is the problem. I tried adding the Funscript references using NuGet as well. I still have the problem.N00bsie
Do you have these two lines at the start of your file: open FunScript and open FunScript.TypeScriptJohn Palmer
Of course,I started the sample application only after I read the tutorial! I have looked through all the code samples in the github and I have been unable to reason out why this error occurs! Is there documentation on the 'Runtime' and the 'Interop' modules?N00bsie
Well, if you don't post your code, I can only guess at the problem. There is documentation on System.Runtime and System.Runtime.InteropServices at MSDN, but the Runtime.Run is not in these libraries, I believe it is something specific to funscript rather than the F# libsJohn Palmer

1 Answers

9
votes

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.