简体   繁体   English

单声道编译器(dmcs)如何引用DLL?

[英]Mono compiler (dmcs) how to reference DLL?

I'm trying to compile an example C# code which makes use of System.Web.HttpUtility . 我正在尝试编译一个使用System.Web.HttpUtility的示例C#代码。 This isn't linked in the core libraries, however, I have (I think so) a DLL that has this namespace, and it is here: /usr/lib/mono/4.0/System.Web.dll . 这在核心库中没有链接,但是,我(我认为是)具有此命名空间的DLL,它位于: /usr/lib/mono/4.0/System.Web.dll

I've tried: 我试过了:

$ dmcs ./UrlBuilder.cs -lib:/usr/lib/mono/4.0/System.Web.dll

But that didn't help. 但这没有帮助。 Any more ideas? 还有什么想法吗?

I believe -lib is meant to specify a path - a directory. 我相信-lib意味着指定一个路径 - 一个目录。 Use -r to add the actual reference. 使用-r添加实际引用。 So for example: 例如:

$ dmcs ./UrlBuilder.cs -r:/usr/lib/mono/4.0/System.Web.dll

Or potentially: 或者可能:

$ dmcs ./UrlBuilder.cs -lib:/usr/lib/mono/4.0 -r:System.Web.dll

Or I'd actually expect this to be okay on its own: 或者我实际上期望它自己也可以:

$ dmcs ./UrlBuilder.cs -r:System.Web.dll

(As Mono should know where its own system libraries are.) (因为Mono应该知道自己的系统库在哪里。)

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

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