2009-05-28 38 views
2

我正在尝试推出一个测试应用程序,以测试使用通过嵌入IronPython进行定制的规则引擎的正版Click One智能客户端应用程序的可行性。IronPython,单击一次,.NET 2.0错误 - 想法?

到目前为止,所有用户,但我调用脚本引擎时得到这个错误(下面)。

我是否需要做一些特殊的事情来强制部署IronPython和Scripting程序集?我认为这是自动的,因为它们在我的项目中被引用。 在.NET 2.0中这只是不可行吗?

想法?

 
************** Exception Text ************** 
System.MissingMethodException: Method not found: 'Void System.Reflection.Emit.DynamicMethod..ctor(System.String, System.Type, System.Type[], Boolean)'. 
    at Microsoft.Scripting.Utils.Helpers.CreateDynamicMethod(String name, Type returnType, Type[] parameterTypes) 
    at Microsoft.Linq.Expressions.Compiler.Snippets.CreateDynamicMethod(String name, Type returnType, Type[] parameterTypes) 
    at Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CreateDynamicLambdaCompiler(CompilerScope scope, String methodName, Type returnType, IList`1 paramTypes, IList`1 paramNames, Boolean closure, Boolean emitDebugSymbols, Boolean forceDynamic) 
    at Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda(LambdaExpression lambda, Type delegateType, Boolean emitDebugSymbols, Boolean forceDynamic, MethodInfo& method) 
    at Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda[T](LambdaExpression lambda, Boolean emitDebugSymbols) 
    at Microsoft.Linq.Expressions.LambdaExpression.Compile[T](Boolean emitDebugSymbols) 
    at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) 
    at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) 
    at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) 
    at UAP.UI.Form1.button1_Click(Object sender, EventArgs e) 
    at System.Windows.Forms.Control.OnClick(EventArgs e) 
    at System.Windows.Forms.Button.OnClick(EventArgs e) 
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 
    at System.Windows.Forms.Control.WndProc(Message& m) 
    at System.Windows.Forms.ButtonBase.WndProc(Message& m) 
    at System.Windows.Forms.Button.WndProc(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 

回答

0

如果右键单击您的项目并转到Properties那里有一个Publish标签,它允许你指定的先决条件安装您的应用程序。

大概你可以在这里提供一个IronPython安装可执行文件的路径。

+0

但我不应该安装它吗?只需按下所需的3个组件? IronPython.dll,Microsoft.Scripting.dll,Microsoft.Scripting.Code.dll - 但我怎么知道这3个程序集是否需要3.0或3.5才能正常运行? – BuddyJoe 2009-05-28 20:17:31

4

IronPython请求者.NET 2.0SP1或更高版本运行。由于在SP1中添加了过载,因此发生此异常。