尝试在F#Interactive中运行FParsec时出现问题

dev*_*ium 9 .net f# visual-studio-2010 f#-interactive fparsec

我试图在F#Interactive中运行一些FParsec代码,但没有成功.我能够构建并运行此tutorial.fs文件,但FSI没有发生同样的情况,因为它无法识别FParsec.dll.

我已经尝试#r "Parsec"在FSI中运行该命令,但它无济于事.

有人知道这里可能出现什么问题吗?

在此输入图像描述

Ste*_*sen 13

FParsec未安装GAC,因此您需要在#r指令中放置dll的完整路径,而不仅仅是程序集的名称.另外,不要忘记"...... FParsec构建为两个DLL.将C#位编译到FParsecCS.dll中,并将F#位(依赖于C#位)编译到FParsec.dll中." (文件第3.2节).例如

#r @"C:\FParsecCS.dll"
#r @"C:\FParsec.dll"
Run Code Online (Sandbox Code Playgroud)

  • 另外,请确保在FParsec之前引用FParsecCS,否则您将收到错误FS0074. (7认同)
  • 每次更改脚本后重置Interactive. (3认同)