Clearscript: IIS V8 Win32Exception Error

Created on 28 Jan 2020  路  10Comments  路  Source: microsoft/ClearScript

I'm trying to publish my ASP.Net Core 3.1 app width ClearScript 6.0 on IIS , Windows but i have this
Error:

System.ComponentModel.Win32Exception (126):
The specified module could not be found
at Microsoft.ClearScript.Util.IJW.IJWHostLibrary.Load()
at Microsoft.ClearScript.V8.V8Proxy.LoadAssemblyWithIJWHostLibrary()
at Microsoft.ClearScript.V8.V8Proxy.GetAssembly()
at Microsoft.ClearScript.V8.V8Proxy.GetImplType(Type type)
at Microsoft.ClearScript.V8.V8Proxy.CreateImplT
at Microsoft.ClearScript.V8.V8IsolateProxy.Create(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags, Int32 debugPort)
at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags, Int32 debugPort)
at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags)
at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints)
at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8ScriptEngineFlags flags, Int32 debugPort)
at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8ScriptEngineFlags flags)

IIS is using "AspNetCoreModuleV2" ,i copy all files to publish folder:
ClearScriptV8-32.dll
ClearScriptV8-64.dll
v8-ia32.dll
v8-x64.dll
v8-base-ia32.dll
v8-base-x64.dll
v8-libcpp-ia32.dll
v8-libcpp-x64.dll

When debug in visual studio i have no problem.
Any help or suggestions ?
Thanks

bug fixed

All 10 comments

Hi @joelpontes,

Make sure you have the Visual Studio Redistributable libraries installed on your deployment machine. Download and install both the 32-bit and 64-bit versions: [x86] [x64].

Good luck!

Yes i have instaled both on deployment machine but same problem.

Notice that on production they create a new folder ".\Microsoft\ClearScript\6.0.0\x64\IJW\ijwhost.dll" is this normal ?

Notice that on production they create a new folder ".\Microsoft\ClearScript\6.0.0\x64\IJW\ijwhost.dll" is this normal?

That file - ijwhost.dll - is part of the .NET Core version of ClearScript. It's embedded in the main ClearScript assembly and unpacked into the file system on first run. It's supposed to be placed under the LocalApplicationData folder; is that not where it's going on your deployment machine?

In any case, we'd like to investigate this issue. Can you provide any details about your IIS deployment and your method of publishing your application?

I create a dummy example to replicate the problem : https://github.com/joelpontes/ClearScriptTest
I Deploy app to a local folder using Visual Studio , then stop IIS and copy the Files to web site IIS folder and start IIS.
Application Pool of web site is .NET CLR version : No Managed Code.

Hi @joelpontes,

Thanks for posting the sample project! We were able to reproduce your issue.

The problem, at least in our case, appears to have been related to application pool identities and permissions. Of the built-in accounts, only LocalSystem worked for us. We also tested with local and domain user accounts; they also worked.

Unfortunately we don't have a full explanation, so we'll keep this issue open and investigate. In the meantime we recommend that you try configuring your application pool to use an authenticated user identity.

Thanks!

Yes change application pool identities and permissions to LocalSystem worked for me.
Thank you very much.

Hi @joelpontes,

We've identified the cause of the issue and will have a fix in the next ClearScript release.

Running your service as LocalSystem may not be wise from a security perspective. With our upcoming fix you'll be able to use least-privileged accounts, such as the application pool identity, for better safety.

Thanks!

I am having a similar problem but only in Azure (Works 100% locally) on only one of my Web projects, but not the other, no clue what the issue is - @ClearScriptLib whats the problem here that would make it work on one Web API project, but not the other? (.NET Core 3.1 FYI)

       4/1/2020 2:45:30 PM  Method GenerateFlow: System.ComponentModel.Win32Exception (126): The specified module could not be found.

     at Microsoft.ClearScript.Util.IJW.IJWHostLibrary.Load()

     at Microsoft.ClearScript.V8.V8Proxy.LoadAssemblyWithIJWHostLibrary()

     at Microsoft.ClearScript.V8.V8Proxy.GetAssembly()

     at Microsoft.ClearScript.V8.V8Proxy.GetImplType(Type type)

     at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args)

     at Microsoft.ClearScript.V8.V8IsolateProxy.Create(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags, Int32 debugPort)

     at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags, Int32 debugPort)

     at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags)

     at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints)

     at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)

     at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)

     at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags)

     at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(String name, V8RuntimeConstraints constraints)

     at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(String name)

@ClearScriptLib

Segment of code failing:

            _engine = new V8ScriptEngine("JFlowScriptEngine")
            {
                AllowReflection = false,
                MaxRuntimeHeapSize = (UIntPtr) MaxRuntimeHeapSize,
                MaxRuntimeStackUsage = (UIntPtr) MaxRuntimeStackUsage
            };

Fixed in Version 6.0.1.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arthurshayne picture arthurshayne  路  3Comments

JohnLudlow picture JohnLudlow  路  4Comments

JohnLudlow picture JohnLudlow  路  4Comments

drearyrainDeng picture drearyrainDeng  路  3Comments

grumpydev picture grumpydev  路  5Comments