Taritsyn / JavaScriptEngineSwitcher

JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines. This library allows you to quickly and easily switch to using of another JavaScript engine.
Apache License 2.0
440 stars 49 forks source link

Documentation says JavaScriptEngineSwitcher.V8 needs Visual C++ 2015 Redistributable #37

Closed saasen closed 7 years ago

saasen commented 7 years ago

Hi.

We've been trying to upgrade this library. We have the following NuGet packages installed:

However, installing the Microsoft Visual C++ 2015 Redistributable doesn't work.

We had to install the Visual C++ Redistributable Packages for Visual Studio 2013 in order for our application to run correctly. Otherwise it would fail at runtime when loading v8.

Is this the intended behaviour, or should it work with Microsoft Visual C++ 2015 Redistributable?

Taritsyn commented 7 years ago

Hello, Anders!

JavaScriptEngineSwitcher.V8.Native.win-x64 => 2.4.10

This version does not exist. Only available version 2.4.2.

Is this the intended behaviour, or should it work with Microsoft Visual C++ 2015 Redistributable?

Native assemblies were compiled by using Visual Studio 2015, therefore they require a Microsoft Visual C++ 2015 Redistributable. It is possible, that in the bin directory remained an old version of the native assemblies. Check a version of the bin/x64/ClearScriptV8-64.dll file (should be version 5.4.9.0).

Also I recommend you to read the “Misconceptions about the JavaScript Engine Switcher version 2.X” discussion.

saasen commented 7 years ago

Hi Andrey!

I'm sorry for that. My NuGet Package Manager showed the wrong version. Indeed, you are right that the latest package is 2.4.2.

Yes, it seems like the file is the correct version (when building locally):

image

We're building our application on TeamCity. Is it possible that has something to do with it?

I also looked at the server where the application was deployed to, and it seems like it was using the old packages somehow. It was not moved to bin/x64/ClearScriptv8-64.dll, but rather to binClearScriptV8-64.dll and with the old version number 5.4.2.0.

I guess I'll have to look into that. Have you seen this error before?

Taritsyn commented 7 years ago

I also looked at the server where the application was deployed to, and it seems like it was using the old packages somehow.

It's not a error, but an old problem with deployment of native assemblies (I've known this problem since days of Classic ASP). Problem is this: process in which the native assemblies were loaded does not allow them to be overwritten. To overwrite the native assemblies need to restart the process. Most often this process is IIS (need to stop/start the website).

It was not moved to bin/x64/ClearScriptv8-64.dll, but rather to bin/ClearScriptV8-64.dll and with the old version number 5.4.2.0.

Most likely the problem in your deployment script.

I recommend you to read the “File lock on LibSassHost.Native-64.dll” discussion.

saasen commented 7 years ago

You know what. I had indeed a problem in my deployment script. It was picking the wrong package from my feed. It is now working correctly, and indeed we need the vcredist2015 package.

Thanks.

Taritsyn commented 7 years ago

Excellent!