Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
F# 使用Codedom在运行时编译F源代码?_F#_.net Assembly - Fatal编程技术网

F# 使用Codedom在运行时编译F源代码?

F# 使用Codedom在运行时编译F源代码?,f#,.net-assembly,F#,.net Assembly,我需要在运行时将一些f源文件编译成程序集 目前,我正在使用它,它做了我需要它做的事情,但似乎这个库还没有得到维护。 我想知道,我用对了吗 注:我看到了一些类似问题的答案,但这些问题都有几年的历史了。这实际上应该交给约翰·帕尔默。。。。他的链接中的spinet基本上是有效的 [<EntryPoint>] let main argv = printfn "%A" argv let scs = SimpleSourceCodeServices(); let fn

我需要在运行时将一些f源文件编译成程序集

目前,我正在使用它,它做了我需要它做的事情,但似乎这个库还没有得到维护。 我想知道,我用对了吗


注:我看到了一些类似问题的答案,但这些问题都有几年的历史了。

这实际上应该交给约翰·帕尔默。。。。他的链接中的spinet基本上是有效的

[<EntryPoint>]
let main argv = 
    printfn "%A" argv

    let scs = SimpleSourceCodeServices();
    let fn = Path.GetTempFileName();
    let fn2 = Path.ChangeExtension(fn, ".fs");
    let fn3 = Path.ChangeExtension(fn, ".dll");

    File.WriteAllText(fn2, """ 
module File1
  let seven =
           3 + 4
        """);

    let errors1, exitCode1 = scs.Compile([| "fsc.exe"; "-o"; fn3; "-a"; fn2 |])
    let ex = File.Exists(fn3)
    printfn "File %s exists: %b" fn3 ex

我必须承认,看到一个非fsc.exe选项会很酷:D

我相信fsharp编译器服务允许这样做-看是的,这是可行的,想把它作为一个答案吗?关于Fsharp.core有一些调整,但现在一切正常