Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue running v1.3.3 and v2.4.13 side-by-side #51

Closed
momadthenomad opened this issue Apr 19, 2018 · 13 comments
Closed

Issue running v1.3.3 and v2.4.13 side-by-side #51

momadthenomad opened this issue Apr 19, 2018 · 13 comments

Comments

@momadthenomad
Copy link

I have a web application with several child web applications.

All the web applications have v1.1.3 installed.

But if I update to the latest version on one of the child web applications, I get this error:
A procedure imported by 'ClearScriptV8-64.dll' could not be loaded.

It has to do with the native dlls and Visual C++ Redistributable for Visual Studio 2015.

Any help is appreciated.

Thanks

@Taritsyn
Copy link
Owner

Hello, Mohamed!

I recommend you to read “How to upgrade applications to version 2.X” section of the documentation and “Misconceptions about the JavaScript Engine Switcher version 2.X” discussion.

@momadthenomad
Copy link
Author

momadthenomad commented Apr 19, 2018

Hello @Taritsyn,

I read all of that and it doesn't help. The problem is that I have nested web applications (parent and child). I am upgrading the child web application with the new version of JavaScriptEngineSwitcher. I installed the VC2015-redist. I got it working as a standalone web app.

Since the parent web app has the web.config lines for JsEngineSwitcher, I am thinking that might be the problem. But also, I ran into an issue where if I install VC2015-redist, the old version stops working (v1.1.3 of the jsEngineSwitcher). But if I also install VC2017-redist, it works again.

But regardless of that, it appears whichever you load first (the parent or child web apps), the other one will fail with this error:

A procedure imported by 'ClearScriptV8-64.dll' could not be loaded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

[FileLoadException: A procedure imported by 'ClearScriptV8-64.dll' could not be loaded.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +478
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +128
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22
   System.Reflection.Assembly.Load(String assemblyString) +34
   Microsoft.ClearScript.V8.V8Proxy.LoadAssembly() +47
   Microsoft.ClearScript.V8.V8Proxy.GetAssembly() +34
   Microsoft.ClearScript.V8.V8Proxy.GetImplType(Type type) +33
   Microsoft.ClearScript.V8.V8Proxy.CreateImpl(Object[] args) +160
   Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags, Int32 debugPort) +273
   Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort) +183
   JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings) +174

@Taritsyn
Copy link
Owner

Upgrade both web applications to version 2.X.

Since the parent web app has the web.config lines for JsEngineSwitcher, I am thinking that might be the problem.

Clearly written in the documentation:

  1. After upgrade of old packages, you must remove the jsEngineSwitcher configuration section group and its declaration from the Web.config and App.config files:

@momadthenomad
Copy link
Author

@Taritsyn, is that the only way?

It is not possible for me to update the parent yet, and in fact, our application is setup with one parent and over 20 children. I was hoping to update them one at a time instead of all in one fell swoop as I don't own all of the apps and have to coordinate the update with the teams that own them.

@Taritsyn
Copy link
Owner

[FileLoadException: A procedure imported by 'ClearScriptV8-64.dll' could not be loaded.]

Check a existance of the ClearScriptV8-64.dll assembly in the bin/x64 directory.

@momadthenomad
Copy link
Author

Yep, it exists. Also the v8-x64.dll exists.

@Taritsyn
Copy link
Owner

Version 1.1.3 require the the Visual C++ Redistributable for Visual Studio 2012, but version 2.4.13 the Microsoft Visual C++ 2015 Redistributable.

@Taritsyn
Copy link
Owner

I can not advise to you anything, because I do not see the source code of your web applications. Try to reproduce these errors on the demo project, and then send me its source code.

@momadthenomad
Copy link
Author

Thanks! It's possible I am having issues because both parent and child are on the same Application Pool in this case. That is not the case in production, so I will test that configuration and see if that resolves my issue.

@Taritsyn
Copy link
Owner

While I can give only one advice: in web applications, that use the older version, leave the JavaScriptEngineSwitcher.V8, but in web applications, that use the new version, install the JavaScriptEngineSwitcher.ChakraCore instead of the JavaScriptEngineSwitcher.V8. When you finish updating of all web applications, you can everywhere return the JavaScriptEngineSwitcher.V8.

@momadthenomad
Copy link
Author

@Taritsyn - my problem is now resolved.

It was due to my test environment running all of the apps in the same App Pool.

I am interested in ChakraCore, are you recommending that I use ChakraCore instead of V8? I don't mind but would love to hear your rationale for ChakraCore.

Thanks

@momadthenomad
Copy link
Author

@Taritsyn - also, it works with VC++ 2017 redist as well.

@Taritsyn
Copy link
Owner

I am interested in ChakraCore, are you recommending that I use ChakraCore instead of V8? I don't mind but would love to hear your rationale for ChakraCore.

At the moment, V8 and ChakraCore engines are very similar in their characteristics, so they can replace each other. The main advantage of the JavaScriptEngineSwitcher.ChakraCore module is cross-platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants