Is there a port of the Rhino JavaScript engine for .NET

让人想犯罪 __ 提交于 2019-12-21 20:00:02

问题


I worked for a company that had both Java and .NET implementations of an application. The app allowed for end-user customization of processing and business rules using scripts. The Java version supported JavaScript using the Rhino engine. The .NET app required VBScript. I would like to do something similar using .NET, but I would prefer to use JavaScript. I have searched but I am having a hard time finding anything like Rhino that will work within the .NET runtime. Do any of you know of or have experience using a JavaScript engine in .NET?


回答1:


You should probably use JScript - Microsoft's implementation of JavaScript, which is a full .NET language.

EDIT: it turns out the question is a duplicate. Some specific suggestions: use Managed JScript, or use MSScriptControl.ScriptControlClass in JScript mode.




回答2:


You can use Rhino on .NET with IKVM.NET. I did it once it was very simple; you download the jar files and you generate dlls using IKVM.NET. Then you reference the dlls as usual.

You should check Iron JS. It is a fully .NET solution running on the DLR.

V8 should work ok as well: http://javascriptdotnet.codeplex.com/



来源:https://stackoverflow.com/questions/398809/is-there-a-port-of-the-rhino-javascript-engine-for-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!