IronRuby错误:Microsoft.Scripting.Actions.Calls.OverloadInfo(尝试移植MEF) [英] IronRuby error: Microsoft.Scripting.Actions.Calls.OverloadInfo (trying to port MEF)

查看:71
本文介绍了IronRuby错误:Microsoft.Scripting.Actions.Calls.OverloadInfo(尝试移植MEF)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从博客文章中升级一些已有4年历史的代码,该文章允许IronRuby导入/导出MEF零件.

I'm trying to upgrade some 4 year old code from a blog post that allows IronRuby to import/export MEF parts.

代码位于: https://github.com/JogoShugh/IronRubyMef

不幸的是,尝试运行时出现此错误:

Unfortunately, I get this error when attempting to run:

Method not found: 'Microsoft.Scripting.Actions.Calls.OverloadInfo[] 
Microsoft.Scripting.Actions.Calls.ReflectionOverloadInfo.CreateArray
(System.Reflection.MemberInfo[])

我在IronRuby论坛上仅找到一个对此的引用,并发送了另一条注释.但是,其他人不知道是什么原因造成的吗?

I only found one reference to this on the IronRuby forum, and sent another note. But, does anyone else have any idea what could cause this?

谢谢

推荐答案

该错误通常是从ruby脚本调用Object.new时引起的.当然应该可以正常工作,IronRuby 1.1.3似乎带有一个错误,如果您执行Object.methods,它实际上会列出:new,但是在调用时会失败.

That error is normally caused when calling Object.new from a ruby script. Which should be working of course, IronRuby 1.1.3 seems to come with a bug where if you do Object.methods it actually lists :new but it fails on invocation.

此修复程序有些简单,只需在需要调用之前将其添加到Ruby程序初始化中即可.

The fix is somewhat simple, just prepend this to your Ruby program initialization, before any requires call:

class System::Object
  def initialize
  end
end

requires 'some/module'

# Rest of your code...

现在,当任何脚本调用Object.new时,它将正常工作.我写了一篇有关此问题的文章: http://github.com/IronLanguages/main中)解决了此问题.您已签出代码并进行构建.

Now, when any script calls Object.new, it'll work correctly.I wrote a post about this issue: http://marcel.bowlitz.com/continuous-integration/custom-resources-in-visual-studio-test-projects
UPDATE: IronRuby 1.1.4 (found in http://github.com/IronLanguages/main) fixes this issue. You have checkout the code and build.

这篇关于IronRuby错误:Microsoft.Scripting.Actions.Calls.OverloadInfo(尝试移植MEF)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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