0

在 Xamarin Studio (Mac OS X) F# 交互窗口中运行此 F# 脚本时出现错误:

#r @"../../packages/RabbitMQ.Client/lib/net45/RabbitMQ.Client.dll"
#r @"../../packages/EasyNetQ/lib/net45/EasyNetQ.dll"

open System
open RabbitMQ.Client
open EasyNetQ

let ServiceBusHost = "host=myRabbitMQServer;virtualHost=someHost;username=someUser;password=somePwd;timeout=0"

let serviceBus = RabbitHutch.CreateBus(ServiceBusHost)

错误:

"Could not resolve field token 0x0400000b" <null>
System.BadImageFormatException: Could not resolve field token 0x0400000b
File name: 'EasyNetQ'
at <StartupCode$FSI_0004>.$FSI_0004.main@ () <0x790eb10 + 0x00153> in <filename unknown>:0 
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x1a55ba0 + 0x000a1> in <filename unknown>:0 
Stopped due to error

但它在 Visual Studio 2015 (Windows) 中运行良好。我已经安装并正确引用了软件包,ServiceBusHost 在 VS 2015 (Windows) 中也可以正常工作。

目标框架:Mono / .NET 4.5 编译器配置:调试/任何 CPU 操作系统:Mac OS X

有任何想法吗?

4

0 回答 0