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?
相关问题
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- Bulk update SQL Server C#
- Should I use static function in c# where many call
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/
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.