Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><em>I realize that this may not be an exact answer to your question, but I figured I would put my 2 cents worth in as I doubt to many people have tried this.</em></p> <p>I got it to work by created a managed wrapper using mixed mode C++. There are other ways to do it, but I was going to attempt to make a full wrapper that could be used from any .Net language.</p> <p>Getting the lib to compile in such a way that it could be included in a mixed mode project was a little bit of a challenge. I had to modify the runtime library (in the SConstruct file) used to /MD and /MDd so that it would be compatible with the /clr switch.</p> <p>So far I have only simple scripts running as I have not implemented callbacks, custom methods, objects and such.</p> <p>Here is a quick sample of what the usage looks like for one of my test apps:</p> <pre><code>V8DotNet.Shell shell = new V8DotNet.Shell(); shell.ExecuteScript(@"print('V8 version is: ' + version());"); </code></pre> <p>It runs more complicated scripts like a base64 encoder fine as well. But for now I can only add custom items from the c++ side.</p> <p>I am willing to provide more information + code if anyone is interested as I may not ever pick this project back up. But, I'm afraid it way to much code to go into a post here so we would have to find some other medium like google code or codePlex.</p> <p><strong>Edit:</strong></p> <hr> <p>OK, I've uploaded the code. I do have to put a disclaimer on this: <em>The project is very early and I am an amateur at C++ at best so don't get your hopes up to much. Also, this project was created/done just after chrome was released so the version of v8 included may be old.</em></p> <p>That said, here it is: <a href="http://ryanscook.com/Files/V8-DotNet.zip" rel="noreferrer">http://ryanscook.com/Files/V8-DotNet.zip</a> (21.5 MB)</p> <p>In the package you'll find the following items of interest:</p> <blockquote> <p><strong>V8Net-Library\V8.Net\V8.Net.sln -</strong> This is the solution that has the managed C++ wrapper proj and a C# console app for testing.</p> <p><strong>Dependencies\V8 -</strong> This is my V8 code that I used to build the V8 lib.</p> </blockquote> <p>Hope it helps!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload