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

Make ClearScript NuGet Package compatible with ASP.Net #109

Closed
JacobcarrellWork opened this issue Apr 17, 2019 · 7 comments
Closed

Make ClearScript NuGet Package compatible with ASP.Net #109

JacobcarrellWork opened this issue Apr 17, 2019 · 7 comments
Assignees

Comments

@JacobcarrellWork
Copy link

JacobcarrellWork commented Apr 17, 2019

The documentation is very confusing as to how to get ClearScript working with ASP.Net MVC. You need to add:

<compilation>
      <assemblies>
        <remove assembly="ClearScriptV8-64" />
        <remove assembly="ClearScriptV8-32" />
      </assemblies>
    </compilation>

To Both the main application web.config and the views' web.config. This is unclear in the instructions. And frankly, Should be included in the readme some NuGet Packages provide when they first get installed.

@upsilondynamics
Copy link

upsilondynamics commented Apr 23, 2019

I am experiencing this issue, after deployment to Azure via Continuous deployment, works fine with local IIS express, but only after I run a post build script to move the DLLS into a folder called ClearScript.V8. IF anyone has more insight into this let me know,

Exception message: Could not load file or assembly 'ClearScriptV8-32.DLL' or one of its dependencies. The specified module could not be found.

*Can someone from the ClearScript team please explain what is the issue here, I understand its likely related to th DLL's being unmanaged native assemblies and when left in IIS bin directory it causes an issue?

.NET 4.7, MVC ASP.NET

@ClearScriptLib
Copy link
Collaborator

ClearScriptLib commented Apr 23, 2019

Hi @upsilondynamics,

Our understanding is that this has to do with the Assembly Shadow Copy feature. For reasons possibly related to code verifiability, mixed-mode assemblies such as ClearScriptV8 cause ASP.NET applications to fail at startup.

These assemblies must therefore be excluded explicitly from startup processing. Have you tried modifying your web.config files as described above and in Section II of Building, integrating, and deploying ClearScript?

Good luck!

@upsilondynamics
Copy link

Nice thanks for the reply (you guys really do reply quick on here, which is great!)

What I did is setup a post build script that moves the DLL's:

ClearScriptV8-32.dll
v8-ia32.dll
v8-x64.dll
ClearScriptV8-64.dll

Into bin\ClearScript.V8 and this seems to work locally, I haven't tried using the tag in the web.config. I am trying to setup a "post deployment" script right now in my Azure Devops to do the same with my Azure Webjob to see i it works, moving these files manually worked so I imagine I can accomplish the same in this script.

@ClearScriptLib
Copy link
Collaborator

Interesting. Does ClearScript still work when you move its V8 assemblies to that folder? If so, are you putting that folder on the executable path?

@upsilondynamics
Copy link

upsilondynamics commented Apr 23, 2019

When the solution is built, those DLL's are being placed in the bin directory (being built from the Nuget package) which causes the issue. I also have copies of the 4 DLL's in the webroot of my website which I placed there and being set to always Copy on Build.

I think the presence of those files in the bin directory is what's causing the issue. It does appear to work this way, do you know if IIS would use the DLL's in the ClearScript.V8 directory I create - or the webroot.

(Current state and it does work - I feel there is obvious redundancy)

-- wwwroot
      ClearScriptV8-32.dll
      v8-ia32.dll
      v8-x64.dll
      ClearScriptV8-64.dll

      --bin
         **(if the 4 dll's are left here, it will cause a failure on startup - so I move them up *see below)
         --ClearScript.V8
               ClearScriptV8-32.dll
               v8-ia32.dll
               v8-x64.dll
               ClearScriptV8-64.dll

Thanks

@ClearScriptLib
Copy link
Collaborator

Hi @upsilondynamics,

With this setup, ClearScript almost certainly loads those assemblies from the application root folder, especially if you aren't adding ClearScript.V8 to the executable path.

By the way, with the web.config change, ClearScript should work with all those assemblies in bin.

Cheers!

ClearScriptLib added a commit that referenced this issue May 2, 2019
…ptEngine and V8Runtime; improved support for newer V8 features such as promises and WebAssembly; added Nothing class for better VBScript support (GitHub Issue #106); added readme.txt to NuGet package (GitHub Issue #109); updated API documentation. Tested with V8 7.4.288.26.
@ClearScriptLib
Copy link
Collaborator

Version 5.5.6 includes a NuGet readme.txt file that provides the required information.

Thanks for your suggestion!

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

No branches or pull requests

3 participants