Question

I'm trying to write a hello world program that prints some basic js to the console using v8dotnet.

I have a simple application

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using V8.Net;

namespace v8test
{
    class Program
    {
        static void Main(string[] args)
        {
            var v8engine = new V8Engine();
        }
    }
}

But it doesn't seem to work

Additional information: Could not load file or assembly 'V8.Net.Proxy.Interface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An operation is not legal in the current state. (Exception from HRESULT: 0x80131509)

I have put all the dll's that come with the binary's in my bin/debug folder and added the reference V8.NET dll (like the documentation described). I've tried multiple combinations of setting x86 or x64 and setting the version of dotnet to 4.0.

I made sure i have the visual c++ 2012 redistribution installed. Regardless of what I try, I can't seem to get it to work. Any help?

Was it helpful?

Solution

For those having this same problem, it turns out is a security issue.

the right setup is to have V8.Net and V8.Net.SharedTypes reference and copy x86 / x64 folders into the bin/debug folder.

For each of the DLL's you have "unblock" them by right clicking and clicking properties on each of the DLL's.

OTHER TIPS

There is a new version of V8.NET out that no longer uses sub-folders. Also, there is no longer a v8.dll, since it is statically linked into the V8.NET C++ projects.

CodePlex is shut down, so the new source is here: https://github.com/rjamesnw/v8dotnet

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top