热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Silverlight4应用程序中的DLR脚本-DLRScriptingwithinSilverlight4Application

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 个解决方案

#1


2  

The Silverlight versions for both IronRuby 1.0 and IronPython 1.0 are hidden in the IronRuby 1.0 for .NET 2.0 SP1 (Zip archive) downloadable from http://ironruby.codeplex.com/releases. In the zip look for silverlight\bin.

IronRuby 1.0和IronPython 1.0的Silverlight版本隐藏在可从http://ironruby.codeplex.com/releases下载的IronRuby 1.0 for .NET 2.0 SP1(Zip归档文件)中。在zip中寻找silverlight \ bin。

The IronRuby 1.1 Silverlight release is also available. IronPython 1.1 for Silverlight however is nowhere to be found. The DLR isn't getting the love from Microsoft it deserves, little documentation, binaries are very hard to find, the future for IronRuby and IronPython doesn't look bright...

IronRuby 1.1 Silverlight版本也可用。然而,Silverlight的IronPython 1.1无处可寻。 DLR并没有得到它应得的微软的爱,很少有文档,很难找到二进制文件,IronRuby和IronPython的未来看起来并不光明......

#2


2  

Just a note to Koen's answer:

只是对Koen答案的一个注释:

The IronPython\Silverlight\bin .dlls from IronPython 2.6.x are .NET 3.5 binaries (work fine in Silverlight 4). The .NET 4 binaries for Silverlight 4 will be available with IronPython 2.7 (currently in alpha).

IronPython 2.6.x中的IronPython \ Silverlight \ bin .dll是.NET 3.5二进制文件(在Silverlight 4中正常工作)。 Silverlight 4的.NET 4二进制文件将与IronPython 2.7(目前处于alpha版)一起提供。

#3


0  

I was looking for some kind of scripting engine compatible with Silverlight, and after hours of research, I've found one. I had not tested yet but I just discovered a project called PaxScript.net that has support for Silverlight 3/4/5. According to the author, you can script using VB.NET, C# and Delphi.NET. It does generate byte-code. I don't know why this project is not known, maybe lack of "disclosure".

我正在寻找与Silverlight兼容的某种脚本引擎,经过数小时的研究,我找到了一个。我还没有测试过,但我刚刚发现了一个名为PaxScript.net的项目,它支持Silverlight 3/4/5。根据作者的说法,您可以使用VB.NET,C#和Delphi.NET编写脚本。它确实生成了字节码。我不知道为什么这个项目不为人知,也许缺乏“披露”。


推荐阅读
  • 搭建Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境的详细步骤
    本文详细介绍了搭建Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境的步骤,包括环境说明、相关软件下载的地址以及所需的插件下载地址。 ... [详细]
  • 本文讨论了在Windows 8上安装gvim中插件时出现的错误加载问题。作者将EasyMotion插件放在了正确的位置,但加载时却出现了错误。作者提供了下载链接和之前放置插件的位置,并列出了出现的错误信息。 ... [详细]
  • 本文介绍了三种方法来实现在Win7系统中显示桌面的快捷方式,包括使用任务栏快速启动栏、运行命令和自己创建快捷方式的方法。具体操作步骤详细说明,并提供了保存图标的路径,方便以后使用。 ... [详细]
  • 本文介绍了在Windows环境下如何配置php+apache环境,包括下载php7和apache2.4、安装vc2015运行时环境、启动php7和apache2.4等步骤。希望对需要搭建php7环境的读者有一定的参考价值。摘要长度为169字。 ... [详细]
  • MyBatis多表查询与动态SQL使用
    本文介绍了MyBatis多表查询与动态SQL的使用方法,包括一对一查询和一对多查询。同时还介绍了动态SQL的使用,包括if标签、trim标签、where标签、set标签和foreach标签的用法。文章还提供了相关的配置信息和示例代码。 ... [详细]
  • Windows7 64位系统安装PLSQL Developer的步骤和注意事项
    本文介绍了在Windows7 64位系统上安装PLSQL Developer的步骤和注意事项。首先下载并安装PLSQL Developer,注意不要安装在默认目录下。然后下载Windows 32位的oracle instant client,并解压到指定路径。最后,按照自己的喜好对解压后的文件进行命名和压缩。 ... [详细]
  • svnWebUI:一款现代化的svn服务端管理软件
    svnWebUI是一款图形化管理服务端Subversion的配置工具,适用于非程序员使用。它解决了svn用户和权限配置繁琐且不便的问题,提供了现代化的web界面,让svn服务端管理变得轻松。演示地址:http://svn.nginxwebui.cn:6060。 ... [详细]
  • Activiti7流程定义开发笔记
    本文介绍了Activiti7流程定义的开发笔记,包括流程定义的概念、使用activiti-explorer和activiti-eclipse-designer进行建模的方式,以及生成流程图的方法。还介绍了流程定义部署的概念和步骤,包括将bpmn和png文件添加部署到activiti数据库中的方法,以及使用ZIP包进行部署的方式。同时还提到了activiti.cfg.xml文件的作用。 ... [详细]
  • Hibernate延迟加载深入分析-集合属性的延迟加载策略
    本文深入分析了Hibernate延迟加载的机制,特别是集合属性的延迟加载策略。通过延迟加载,可以降低系统的内存开销,提高Hibernate的运行性能。对于集合属性,推荐使用延迟加载策略,即在系统需要使用集合属性时才从数据库装载关联的数据,避免一次加载所有集合属性导致性能下降。 ... [详细]
  • 本文介绍了在无法联网的情况下,通过下载rpm包离线安装zip和unzip的方法。详细介绍了如何搜索并下载合适的rpm包,以及如何使用rpm命令进行安装。 ... [详细]
  • PatchODAX8: ... [详细]
  • 本文详细介绍了GetModuleFileName函数的用法,该函数可以用于获取当前模块所在的路径,方便进行文件操作和读取配置信息。文章通过示例代码和详细的解释,帮助读者理解和使用该函数。同时,还提供了相关的API函数声明和说明。 ... [详细]
  • 本文介绍了使用kotlin实现动画效果的方法,包括上下移动、放大缩小、旋转等功能。通过代码示例演示了如何使用ObjectAnimator和AnimatorSet来实现动画效果,并提供了实现抖动效果的代码。同时还介绍了如何使用translationY和translationX来实现上下和左右移动的效果。最后还提供了一个anim_small.xml文件的代码示例,可以用来实现放大缩小的效果。 ... [详细]
  • 如何去除Win7快捷方式的箭头
    本文介绍了如何去除Win7快捷方式的箭头的方法,通过生成一个透明的ico图标并将其命名为Empty.ico,将图标复制到windows目录下,并导入注册表,即可去除箭头。这样做可以改善默认快捷方式的外观,提升桌面整洁度。 ... [详细]
  • 1.官网下载了mysql-5.7.17-win64.zip包,配置遇到很多麻烦,记录一下;2.解压后放到指定的文件夹,修改mysql-5.7.17的配置文件my-default.i ... [详细]
author-avatar
mobiledu2502871653
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有