V8.NET (v8dotnet) mono

本文关键字:mono v8dotnet NET V8 | 更新日期: 2023-09-27 18:27:02

希望有人有一点时间来解释如何将V8.Net与Mono一起使用。我正在尝试在我的ubuntu机器上使用V8.Net和mono 3.10。到目前为止,我做了以下工作:

  1. 使用codeplex 上的内容创建一个示例项目

      using System;
      using V8.Net;
      namespace testv8
     {
         class MainClass
         {
                 public static void Main (string[] args)
                 {
    
                    var v8Engine = new V8Engine();
                    Handle result = v8Engine.Execute("/* Some JavaScript Code Here*/","My V8.NET Console");
                    Console.WriteLine(result.AsString); // (or "(string)result")
                    Console.WriteLine("Press any key to continue ...");
                    Console.ReadKey(); 
    
                    Console.WriteLine ("Hello World!");
            }
         }
      }
    
  2. 将V8.Net.dll和V8.NetSharedTypes添加到引用

  3. 我将文件夹/Release/NET 4.0/x64的内容复制到我的构建目录的/bin/Debug/x64

  4. 当我尝试运行该示例时,我会得到以下错误:系统。引发了DllNotFoundException。

  5. 我将构建类型从Debug更改为(Debug|Any cpu)。如果我理解正确,库现在应该选择正确的dll。

6当我在这种模式下重新运行程序时。程序停止于:已加载程序集:/Build/v8dotnet/testv8/testv8/bin/test/x4/V8.Net.Proxy.Interface.x64.dll[External]

调用堆栈显示:V8.Net.V8NetProxy.CreatehandleProxyTest().

希望你能给我一些意见,让它运行起来。

V8.NET (v8dotnet) mono

简短说明:在使V8.Net与Mono一起用于不同平台(Win、Linux和Mac)方面取得了一些进展。以下网站提供了更多信息:
Mono Github分支
V8.Net单声道问题

更新:不再支持单声道。现在支持Net Standard,它也是跨平台的。

NuGet:https://www.nuget.org/packages/V8.Net/

CodePlex现已关闭。新的来源在这里:https://github.com/rjamesnw/v8dotnet