引用.NET的DLL时,编图(单声道) [英] Referencing .NET dll when compiliation(with mono)

查看:135
本文介绍了引用.NET的DLL时,编图(单声道)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问一个问题,安装F#动力组,并用它<一个href="http://stackoverflow.com/questions/6206406/how-to-install-and-use-f-powerpack-in-mono">here.

 错误FS0078:无法找到文件'FSharp.PowerPack.Linq.dll'中的任何一种
 /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/mono/2.0
 /用户/ smcho /桌面/ FS /动力组
 /Users/smcho/smcho/bin/FSharp-2.0.0.0/bin
 

当我运行此命令 FSC linq.fs /r:FSharp.PowerPack.Linq.dll ,我得到了与单此错误消息。

这似乎与 / R:,单F#编译器似乎找到

该dll
  1. /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/mono/2.0&LT; - 单目录
  2. /Users/smcho/smcho/bin/FSharp-2.0.0.0/bin&LT; - F#目录
  3. /用户/ smcho /桌面/ FS /动力组&LT; - 当前目录。

不过,我不想复制所有的DLL在当前目录下,有没有什么办法让单F#和C#编译器知道在哪里可以找到该dll比这两个目录以外的?

看来MONO_PATH和 GACUTIL -i 对查找DLL在运行时,不编译时间。

ADDED

/ I:选项适用于 FSC 编译

  FSC linq.fs /I:/bin/FSharpPowerPack-1.9.9.9/bin/gac /r:FSharp.PowerPack.Linq.dll
 

解决方案

你就不能使用

-r:/全速/路径/到/的/参考/组装

? (你是正确的,GACUTIL用于运行时组件,而-r是设计时的参考组件,这可能会或可能不会是相同的。)

I asked a question to install F# powerpack and use it here.

error FS0078: Unable to find the file 'FSharp.PowerPack.Linq.dll' in any of
 /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/mono/2.0
 /Users/smcho/Desktop/fs/powerpack
 /Users/smcho/smcho/bin/FSharp-2.0.0.0/bin

When I run this command fsc linq.fs /r:FSharp.PowerPack.Linq.dll, I got this error message with mono.

It seems that with /r:, the mono F# compiler seems to find the dll in

  1. /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/mono/2.0 <-- mono directory
  2. /Users/smcho/smcho/bin/FSharp-2.0.0.0/bin <-- F# directory
  3. /Users/smcho/Desktop/fs/powerpack <-- current directory.

However, I don't want to copy all the dll's in the current directory, is there any way to let mono F# or C# compiler know where to find the dll other than those two directory?

It seems that MONO_PATH and gacutil -i is for finding the dll at runtime, not compile time.

ADDED

/I: option is available with fsc compiler.

fsc linq.fs /I:/bin/FSharpPowerPack-1.9.9.9/bin/gac /r:FSharp.PowerPack.Linq.dll

解决方案

Can't you just use

-r:/full/path/to/the/reference/assembly

? (You are right that gacutil is for runtime assemblies, whereas -r is for design-time reference assemblies, which may or may not be the same.)

这篇关于引用.NET的DLL时,编图(单声道)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆