2

我正在尝试推出一个测试应用程序来测试纠正 Click Once Smart Client 应用程序的可行性,该应用程序还使用通过嵌入 IronPython 可定制的规则引擎。

到目前为止,除了我之外的所有用户在调用脚本引擎时都会收到此错误(如下)。

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

想法?

************** 异常文本 **************
System.MissingMethodException:找不到方法:'Void System.Reflection.Emit.DynamicMethod..ctor(System.String, System.Type, System.Type[], Boolean)'。
   在 Microsoft.Scripting.Utils.Helpers.CreateDynamicMethod(字符串名称,类型 returnType,类型 [] 参数类型)
   在 Microsoft.Linq.Expressions.Compiler.Snippets.CreateDynamicMethod(字符串名称,类型 returnType,类型 [] 参数类型)
   在 Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CreateDynamicLambdaCompiler(CompilerScope 范围,字符串方法名称,类型 returnType,IList`1 paramTypes,IList`1 paramNames,布尔闭包,布尔 emitDebugSymbols,布尔 forceDynamic)
   在 Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda(LambdaExpression lambda,类型 delegateType,布尔型 emitDebugSymbols,布尔型 forceDynamic,MethodInfo& 方法)
   在 Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda[T](LambdaExpression lambda, Boolean emitDebugSymbols)
   在 Microsoft.Linq.Expressions.LambdaExpression.Compile[T](Boolean emitDebugSymbols)
   在 Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression 代码,Scope 范围)
   在 Microsoft.Scripting.SourceUnit.Execute(范围范围,ErrorSink errorSink)
   在 Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope 范围)
   在 UAP.UI.Form1.button1_Click(对象发送者,EventArgs e)
   在 System.Windows.Forms.Control.OnClick(EventArgs e)
   在 System.Windows.Forms.Button.OnClick(EventArgs e)
   在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs 事件)
   在 System.Windows.Forms.Control.WmMouseUp(消息和 m,MouseButtons 按钮,Int32 点击)
   在 System.Windows.Forms.Control.WndProc(消息和 m)
   在 System.Windows.Forms.ButtonBase.WndProc(消息和 m)
   在 System.Windows.Forms.Button.WndProc(消息和 m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(消息& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(消息和 m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)
4

2 回答 2

4

IronPython 需要 .NET 2.0SP1 或更高版本才能运行。此异常是由于 SP1 中添加的过载而发生的。

于 2009-05-28T21:52:22.790 回答
0

如果您右键单击您的项目并转到Properties一个Publish选项卡,它允许您为您的应用程序指定先决条件安装。

大概您可以在此处提供 IronPython 安装可执行文件的路径。

于 2009-05-28T19:19:06.220 回答