如何在Mac上使用从nuget下载的软件包(Mono)

时间:2015-02-09 17:45:25

标签: c# f# mono nuget

我尝试使用nuget下载软件包。例如,我正在尝试使用suave.io在Mac上使用F#进行Web编程。

使用nuget(别名为'mono /bin/mono/nuget.exe'),我可以下载软件包。

nuget install Suave 
Attempting to resolve dependency 'FSharp.Core (≥ 3.1.2.1)'.
Attempting to resolve dependency 'FsPickler (≥ 1.0.7)'.
Installing 'FSharp.Core 3.1.2.1'.
Successfully installed 'FSharp.Core 3.1.2.1'.
Installing 'FsPickler 1.0.7'.
Successfully installed 'FsPickler 1.0.7'.
Installing 'Suave 0.24.0'.
Successfully installed 'Suave 0.24.0'.

问题是,与在/ usr / local / Cellar中安装软件包的brew相比,它下载了当前目录中的软件包(库)。

将下载的库与Mono一起使用的下一步是什么?更好的是,有没有办法轻松使用下载并从我的F#/ C#代码安装库?

1 个答案:

答案 0 :(得分:1)

从问题的评论中,我可以使suave webserver工作。

我将下载的包复制到我收集nuget包(/bin/mono/)的地方。然后,我制作了F#脚本(hello.fsx)。

#r @"/bin/mono/Suave.0.24.0/lib/net40/Suave.dll"

open Suave                 // always open suave
open Suave.Http.Successful // for OK-result
open Suave.Web             // for config

web_server default_config (OK "Hello World!")

使用fsharpi hello.fsx运行代码可使Web服务器正常运行。