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
439 stars 49 forks source link

Could not load file or assembly 'file:///D:\home\site\wwwroot\bin\ClearScriptV8.win-x64.dll' or one of its dependencies. Could not find or load a specific file. #101

Closed DarthSonic closed 2 years ago

DarthSonic commented 2 years ago

1) The file ClearScriptV8.win-x64.dll is existing in bin path of web app. 2) JavaScriptEngineSwitcher.V8.Native.win-x64 was deinstalled because of deprecation notice 3) Microsoft.ClearScript.V8.Native.win-x64 is installed 4) running locally on IISExpress works 5) after using Web Publish to deploy to Azure Web App, error is:

Could not load file or assembly 'file:///D:\home\site\wwwroot\bin\ClearScriptV8.win-x64.dll' or one of its dependencies. Could not find or load a specific file.

Taritsyn commented 2 years ago

Hello, Sven!

What versions of the JavaScriptEngineSwitcher.V8 and Microsoft.ClearScript.V8.Native.win-x64 packages do you use?

Taritsyn commented 2 years ago
  1. running locally on IISExpress works
  2. after using Web Publish to deploy to Azure Web App, error is:

Most likely, your deployment script does not copy the ClearScriptV8.win-x64.dll file.

DarthSonic commented 2 years ago

updated to latest versions 3.17.2 and 7.2.2

Taritsyn commented 2 years ago

Apparently, this is a deployment error. You may have to manually edit the deployment script.

DarthSonic commented 2 years ago
  1. running locally on IISExpress works
  2. after using Web Publish to deploy to Azure Web App, error is:

Most likely, your deployment script does not copy the ClearScriptV8.win-x64.dll file.

Meanwhile I figured out a way to solve it:

The file was existing but seems not to be overridden correctly by Web Publish. So I removed bin-folder manually by using App Service Editor (or alternatively Kudu). After the next deploy it worked.

I can remember that happend the last time I updated JavaScriptEngineSwitcher and/or ClearScript package too. Maybe there is some problem with file getting locked and not released as other files in the bin-folder do not have that problem?

Taritsyn commented 2 years ago

In principle, updating of native assemblies always require an restart of IIS or application pool.

DarthSonic commented 2 years ago

For sure, but there is no problem with any other DLL than ClearScriptV8.win-x64.dll.

I will close that issue.

Taritsyn commented 2 years ago

How many of these assemblies are native?

DarthSonic commented 2 years ago

Can't tell you. I did not dive into this that deeply.

Taritsyn commented 2 years ago

It is quite possible that all other assemblies are managed.