I have issues with ClearScript. When I use them from regular project (class library or wpf), when dependency is added through nuget, also a post build script is added that copies ClearScriptV8-32.dll
, ClearScriptV8-64.dll
, v8-ia32.dll
and v8-x64.dll
to bin
directory and everything works well. But when I try to use this library with new ASP.NET, things go wrong.
Nuget ClearScript package for dnx is downloaded to
C:\Users\lukasz\.dnx\packages\ClearScript.V8\5.4.3\lib\net40
I mean, ClearScript.dll
is there but those 4 other files are not (they are ..\..\tools\native\{x86,amd64}\*
, just like in case of desktop app), and when I run app it says
System.IO.FileNotFoundException: Cannot find file 'C:\Users\lukasz\.dnx\packages\ClearScript.V8\5.4.3\lib\net40\ClearScriptV8-32.dll'
So following my experiences from regular projects, I just copied those 4 files from
.dnx\packages\ClearScript.V8\5.4.3\tools\native\{x86,amd64}\*
to
.dnx\packages\ClearScript.V8\5.4.3\lib\net40
And then I get this error
Error: error CS0009: Metadata file 'C:\Users\lukasz\.dnx\packages\ClearScript.V8\5.4.3\lib\net40\v8-x64.dll' could not be opened -- PE image doesn't contain managed metadata.
error CS0009: Metadata file 'C:\Users\lukasz\.dnx\packages\ClearScript.V8\5.4.3\lib\net40\v8-ia32.dll' could not be opened -- PE image doesn't contain managed metadata.
I would asume that those dlls are somehow not valid for web version, maybe I need to get those dlls in some different way?
I could reproduce the issue creating new ASP.NET 5 project from WebApi template. I use single framework dnx46
, no core
as the projects I use are not compiled against it anyway. I use ClearScript.V8 5.4.3
. DNX SDK version is 1.0.0-rc1-update1
.
I am simply creating
var engine = new V8ScriptEngine();
in the controller method.