繁体   English   中英

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

[英]How to use packages download from nuget on Mac (Mono)

我试着用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#代码安装库?

从问题的评论中,我可以使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服务器正常工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM