I was looking for the same and found it: it is in FSharp.Compiler.CodeDom.dll which is part of the PowerPack.

And here you find where to download it:

[link:cs.hubfs.net]

Martin

By on 6/12/2009 1:52 AM ()

hi!

i am also interested in that one.

and can somebody point out a simple sample of how to run the fsharp compiler?

thanks,
sebastian

By on 6/3/2009 4:36 AM ()

Here is a simple example which actually also calls the just-created method.

Martin

let compiler = new FSharpCodeProvider()
let code = "#light\nmodule GeneratedCode\n let GenTest = fun () -> printfn \"from generated code\"\n"
let options = new CompilerParameters()
options.GenerateInMemory <- true
let cr = compiler.CompileAssemblyFromSource(options, [|code|])
printfn "Compiler return value: %d" cr.NativeCompilerReturnValue
for s in cr.Output do printfn "%s" s
for e in cr.Errors do printfn "%O" e
let ass = cr.CompiledAssembly
let modul = ass.GetType("GeneratedCode")
printfn "module %O" modul
let funcs = modul.GetMember("GenTest")
let func = funcs.[0] :?> MethodInfo
let typ = func.GetType()
printfn "member %A of type %A" func typ.FullName
func.Invoke(None,[||]) |> ignore
printfn "compiler test done."

By on 6/12/2009 2:03 AM ()

Actually, my above example runs fine with the 2008 CTP / VS2008. However, with the new VS2010 Beta, I get a Win32Exception "The system cannot find the file specified" when the compiler is called.

Any idea what the issues is and if there is a workaround?

Martin

By on 6/12/2009 4:37 AM ()

I had the same problem.
What you have to do is copy the \bin folder contents of your fsharp installation to your exe directory (most files are probably useless by I didn't figure yet which files are essential for the program).

Hope this helps

By on 6/16/2009 7:14 PM ()

I also had this problem.

I just copied fsc.exe to my exe directory and it worked.

By on 9/13/2009 8:35 AM ()

The FSharp.Compiler.CodeDom is located within the PowerPack and apparently that should be up on CodePlex sometime in the next few days.

By on 5/21/2009 4:03 PM ()

Any news on when PowerPack will be released? I can't find its page on CodePlex.

Thanks,
- Jeff

By on 6/1/2009 1:29 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper