This project has moved and is read-only. For the latest updates, please go here.

ClearScript on ASP 5

May 6, 2015 at 2:41 PM
Is there any progress on a version of ClearScript that will work with ASP .NET 5 projects?

I have managed to get it working eventually with some hacking about. I ended up dropping the v8 DLLs in to the dnx bin path as this is one location that gets searched when ClearScript looks for its dependencies.
Coordinator
May 6, 2015 at 4:07 PM
Hello,

We haven't yet done any testing with pre-release ASP.NET. It sounds like you encountered some assembly loading issues? We'd love to know the details.

Thanks!
May 6, 2015 at 5:13 PM
Thanks for the reply. That's fine, I'm very happy to help.

The ClearScript.V8 nuget package fails to add the native assemblies to the xproj. My guess is the $DTE style control of a project is no longer supported with these project types. From my searches I haven't yet found the proper way to include native binaries which will work with xproj. I have played around with my own

When run using dnx the locations which ClearScript ends up searching are relative to the dnx binaries and not a project bin directory (as these don't really exist anymore)

I think the simplest solution (if it is possible) will be to add a build step which combines the native and managed DLLs in to a single DLL. This DLL then lives in the /lib folder of the nuget package. I will attempt this locally when I get a chance to see if it is feasible. Though I don't know how this would work across x86 and x64.
Coordinator
May 7, 2015 at 2:59 PM
Hi again,

As we don't distribute ClearScript binaries, we can't assist with NuGet package issues, and we recommend that you contact the package owners.

Alternatively, because ClearScript loads its V8 assemblies explicitly, you should be able to place them wherever it's convenient and override the default loading procedure with a simple AssemblyResolve hook. There's an example and some additional information here.

Good luck!
May 7, 2015 at 3:30 PM
Ah my mistake, I thought this team would be responsible for the nuget packages. I will contact the owners there to coordinate with them.

The custom AssemblyResolve hook looks promising!

Thanks