1

我已经生成了一个互操作 DLL。工作正常。奇怪的是,在 C# 中可见的事件在 F# 中不可见。幸运的是,DLL 中存在添加/删除函数来添加/删除我的处理程序。所以有一个解决方法。

我不明白为什么我不能看到实际的事件参数本身,因为它们是界面的一部分。在生成用于 F# 的互操作时,有什么特别需要做的吗?就好像事件的访问修饰符在 F# 中查看时是私有的或受保护的,但在 C# 中不是

4

1 回答 1

1

Possibly you are using the Client profile, switch to the full .Net 4.0 profile in project properties and try that. In VS2010 thats the default setting and it catches a lot of people out.

Another possibility is that it is a non standard event implementation, I encountered that in MonoTouch yesterday.

Failing those I would have a look at the dll with reflector or similar and see whats what with the generated code.

于 2013-02-11T11:12:06.973 回答