作者:mobiledu2502871653 | 来源:互联网 | 2023-05-18 09:22
IwouldliketoaddsomescriptingsupporttoaSilverlight4applicationthatImworkingon.Ihav
I would like to add some scripting support to a Silverlight 4 application that I'm working on. I have the latest stable releases of both IronRuby and IronPython installed on my machine with Visual Studio 2010. I looked at some samples of using the ScriptEngine class with both IronRuby and IronPython. I even got it to work in a small Windows Forms app to make sure my code works. However, I can't seem to Add Reference for the required Assemblies/DLLs to my Silverlight 4 application.
我想为我正在处理的Silverlight 4应用程序添加一些脚本支持。我使用Visual Studio 2010在我的机器上安装了IronRuby和IronPython的最新稳定版本。我查看了使用ScriptEngine类同时使用IronRuby和IronPython的一些示例。我甚至让它在一个小的Windows窗体应用程序中工作,以确保我的代码工作。但是,我似乎无法将所需的程序集/ DLL的参考添加到我的Silverlight 4应用程序。
Here's my ScriptEngine code:
这是我的ScriptEngine代码:
ScriptEngine engine = Ruby.CreateEngine();
engine.Runtime.Globals.SetVariable("MainPage", this);
string code = "MainPage.txtTitle.Text = \"Hello from IronRuby!\"";
engine.Execute(code);
And, here's my using statements that it requires:
而且,这是我需要的使用语句:
using IronRuby;
using Microsoft.Scripting.Hosting;
When I try to Add Reference to the following Assemblies/DLLs from the IronRuby 1.0 release, Visual Studio 2010 doesn't let me add them and provides no exception message as to why. As a result I am unable to compile the solution.
当我尝试从IronRuby 1.0版本添加对以下程序集/ DLL的引用时,Visual Studio 2010不允许我添加它们并且不提供关于原因的异常消息。结果我无法编译解决方案。
IronRuby.dll
IronRuby.Libraries.dll
IronRuby.Libraries.YAML.dll
Microsoft.Dynamic.dll
Microsoft.Scripting.Debugging.dll
Microsoft.Scripting.dll
I assume that the reason Visual Studio 2010 isn't letting me add the Assemblies/DLLs is because they are compiled for .NET and not Silverlight.
我假设Visual Studio 2010不允许我添加程序集/ DLL的原因是因为它们是针对.NET而不是Silverlight编译的。
Does anyone know where I can get Silverlight 4 versions of those assemblies or exactly what I'm doing incorrectly?
有谁知道我可以在哪里获得Silverlight 4版本的那些程序集或者我正在做错误的做法?
Any help would be appreciated. Thanks!
任何帮助,将不胜感激。谢谢!
3 个解决方案