我有一个C#程序调用这个F#代码snipet。在执行let fsiSession
时,我得到下面的例外。这些site暗示了一些想法,但我不明白他们在说什么。我不知道在哪里找到了FSharp.Core.optdata。FSharp.Core.optdata没有在FSharp上找到.Core
namespace FsharpTestgSystem
open System
open System.IO
open System.Text
open System.CodeDom
open Microsoft.FSharp.Compiler.SourceCodeServices
open Microsoft.FSharp.Compiler.Interactive.Shell
open Microsoft.FSharp.Compiler.SimpleSourceCodeServices
type TestSystem() =
// Intialize output and input streams
// Build command line arguments & start FSI session
let argv = [| "C:\\Program Files (x86)\\Microsoft SDKs\\F#\\4.1\\Framework\\v4.0\\fsi.exe" |]
let allArgs = Array.append argv [|"--noninteractive"|]
let sbOut = new StringBuilder()
let sbErr = new StringBuilder()
let inStream = new StringReader("")
let outStream = new StringWriter(sbOut)
let errStream = new StringWriter(sbErr)
let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration()
let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream)
unknown(1,1): error FS1225: File '\bin\x64\Debug\FSharp.Core.optdata' not found alongside FSharp.Core
unknown(1,1): error FS0229: Error opening binary ...
这是说它应该在SDK目录中。 [SO链接](http://stackoverflow.com/questions/21224314/what-are-fs-fsharp-core-optdata-and-fsharp-core-sigdata-files/)顺便说一句,我能找到的唯一地方这个文件在Fake/tools中。 – s952163