Closed github-prometheus closed 7 years ago
Hello, Pramod!
Are you using the ClearScript.V8 package?
yes
You can not install the JavaScriptEngineSwitcher.V8 and ClearScript.V8 packages together. Both projects contain their own versions of assemblies, which signed by own keys. By the way, ClearScript.V8 package is unofficial. In general, Microsoft does not have an official NuGet package for the ClearScript library, and everyone builds the ClearScript on their own.
Uninstall the ClearScript.V8 package and read the “JS Engine Switcher: V8” section of documentation.
Ok. Uninstalling the clearscript will add the required assemblies in the bin folder ? Currently I am adding those native dlls using a post build event.
Uninstalling the clearscript will add the required assemblies in the bin folder ?
Have you read the “JS Engine Switcher: V8” section of documentation? Or at least the JavaScriptEngineSwitcher.V8 package description?
Yes I installed those packages as well. Also I have installed the vc++ redist. 2015
Currently I am adding those native dlls using a post build event.
You just need to install the JavaScriptEngineSwitcher.V8.Native.win-x86 and/or JavaScriptEngineSwitcher.V8.Native.win-x64 packages.
Yes I installed those packages as well. Also I have installed the vc++ redist. 2015
Then should all work correctly. If it doesn't work, then clean your project from garbage: the ClearScript.V8 package artifacts and custom post build events.
Hi Taritsyn,
Following your steps enabled the local application to run successfully but when deployed to the server, The folders X86 and x64 folders didnt get created in the websites bin folder but a ClearScript folder got generated in the in project folder and I am getting the same error.
Just to be clear, does the ClearScript.V8 folder gets created in the project folder ?
Thanks Pramod
Since version 2.0 the ClearScript.V8
directory is not created. Assemblies are copied by using MSBuild scripts to x86
and x64
subdirectories of bin\[Debug|Release]
directory (for web applications just bin
directory).
So Andrey please correct me if I am wrong : for web application the ClearScript.V8 directory does not get created and the dlls directly get copied to bin/x86 and bin/x64 respectively.
In my local I can observe the changes but in remote server its getting created. I am using bamboo to create the installer.
On Thu, May 11, 2017 at 11:02 PM, Andrey Taritsyn notifications@github.com wrote:
Since version 2.0 the ClearScript.V8 directory is not created. Assemblies are copied by using MSBuild scripts to x86 and x64 subdirectories of bin[Debug|Release] directory (for web applications just bin directory).
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/29#issuecomment-300861289, or mute the thread https://github.com/notifications/unsubscribe-auth/AbS-x3nydMdAz_Wv9vHaU6THvN_h6wkTks5r40Y2gaJpZM4NXyZ3 .
So Andrey please correct me if I am wrong : for web application the ClearScript.V8 directory does not get created and the dlls directly get copied to bin/x86 and bin/x64 respectively.
Yes, that's right.
In my local I can observe the changes but in remote server its getting created. I am using bamboo to create the installer.
In this matter I can not help you. Check your installer or deployment scripts.
Thanks Andrey I will check that.
I added those assemblies as link in root project directory
Also Andrey, Can we use the latest version with BundleTransformer v1.8.32 ?
cause when i did I got the exception message like :
Method not found: 'JavaScriptEngineSwitcher.Core.JsEngineSwitcher JavaScriptEngineSwitcher.Core.JsEngineSwitcher.get_Current()'.
Can we use the latest version with BundleTransformer v1.8.32 ?
It's too old version. Since Bundle Transformer version 1.9.122 supports the JavaScript Engine Switcher version 2.X. I recommend to read the “How to upgrade applications to version 2.X” section of the documentation and upgrade the Bundle Transformer to latest version.
And let's finish this discussion. After all, this is an open source projects, but not a paid support service.
Ok.. Sure Andrey. Thanks a lot :)
Hi Andrey ,
I read the article at link1. I also checked for msvcp140.dll
. Then I added a nuget package for JavaScriptEngineSwitcher.V8
(2.4.2) and JavaScriptEngineSwitcher.V8.Native.win-x86
(2.4.2). Then I added following code
using Microsoft.ClearScript.V8;
public static void main(){
var en = new V8ScriptEngine();
}
But I am getting exception as Could not load file or assembly 'ClearScriptV8-32.DLL' or one of its dependencies. The specified module could not be found.
. I am clueless here. My project is in 4.5.1 framework. Any inputs as what I am missing?
I have uploaded the sample code at link2
Hello, Prasad!
You incorrectly create an instance of JS engine. Forget about the V8ScriptEngine
class from Microsoft.ClearScript.V8
namespace, you need to use the V8JsEngine
class from JavaScriptEngineSwitcher.V8
namespace.
I recommend you to read the “Creating instances of JS engines” and “JS Engine Switcher: V8” sections of documentation.
Hello Andrey,
I read the articles and I changed the code to what you have suggested but unfortunately I am getting the said error even before the execution hits the break point. The exception is being thrown by CLR on home page launch (which does not have engine creation code).
PS: I am using VS2015.
In your project the ClearScriptV8-32.dll
and v8-ia32.dll
assemblies are located outside of the bin/x86
directory.
Thanks a ton Taritsyn. I had copied them out earlier with the previous incorrect implementation. Now the issue is fixed
Hi Taritsyn,
I added the JavaScriptEngineSwitcher.V8 nuget package version 2.4.0 to my asp.net mvc4 application and made necessary changes in the Global.asax.cs file and also in the web.config but when I run my application, I am getting the error as
Here I noticed the thing that the public key token 935d0c957da47c73 is coressponds to the ClearScript version 5.4.7
If I install the JavaScriptEngineSwitcher.V8 nuget package version 2.1.0, the application runs fine since it finds the correct version of the ClearScript.
Can you please confirm if this is a potential bug that might have been caused while publishing nuget package? Please find the attached screenshots that corresponds to the public key token of the ClearScript.dll version 5.4.9 and 5.4.7 respectively.
Thanks, Pramod