1

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?

James Wilkins
  • 6,836
  • 3
  • 48
  • 73
user1167650
  • 3,177
  • 11
  • 34
  • 46
  • Don't put the binaries in `bin\Debug` folder. Put them somewhere else and then add reference. When you build the project, the build process will copy the required binaries in `bin\Debug` folder. – YK1 Dec 18 '13 at 05:12
  • same error. it says could not find but my DLL's are called _x86 and _x64 ...could it be related to that? – user1167650 Dec 18 '13 at 05:16
  • Just to add, when it copies dll's into the debug folder, it only copies v8.NET.dll and V8.Net.SharedTypes.dll – user1167650 Dec 18 '13 at 05:23
  • 1
    Documentation is strange - anyway, the zip file seems to come with `x86` and `x64` folders. Dont copy the content of those folders to `bin\Debug` - instead copy the whole folder as is. Meaning, you should have folders `\bin\Debug\x86` and `bin\Debug\x64`. – YK1 Dec 18 '13 at 05:36
  • I tried that, but I still seem to get the same error, heh. – user1167650 Dec 20 '13 at 23:22

2 Answers2

2

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.

user1167650
  • 3,177
  • 11
  • 34
  • 46
0

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

James Wilkins
  • 6,836
  • 3
  • 48
  • 73