GithubHelp home page GithubHelp logo

Comments (6)

spahnke avatar spahnke commented on July 29, 2024 2

We use this library in a ASP.NET web application on .NET Framework successfully for a while now. From what we've learned over the years the following things are typically the cause of those errors.

IIS has to run in 64 bit mode

Should be self explanatory, this holds for both IIS and IIS Express (make sure to tick the box in the VS settings).

Missing Visual C++ Redistributable

You must have the Visual C++ Redistributable package installed on the target machine. This can be checked easily by compiling the included Fiddling project (as 64 bit exe) and running that on the target machine.

Running into assembly load problems in IIS

IIS/IIS Express attempts to load every assembly present in the bin/ folder, including the unmanaged V8 specific ones. This led to similar errors for us before. We solved that problem by not including the JavaScript.Net.dll and other V8 assemblies in the bin/ folder, but instead deploying those into a sibling folder. You can then use the AssemblyResolve callback on the AppDomain to resolve JavaScript.Net.dll from the sibling folder (see e.g. https://stackoverflow.com/a/5262129). This is typically setup in the Global.asax.cs.

Edit: Now that I'm at work here is the snippet we use

var serverPath = System.Web.HttpContext.Current.Server.MapPath("/");
AppDomain.CurrentDomain.AssemblyResolve += (sender, args)
    => args.Name.StartsWith("JavaScript.Net") ? Assembly.LoadFrom(serverPath, @"V8\JavaScript.Net.dll")) : null;
WebApp
    |--bin
        |--...
    |--V8
        |--JavaScript.Net.dll
        |--icuuc.dll
        |--...

Good luck!

from javascript.net.

oliverbock avatar oliverbock commented on July 29, 2024

You will need to include all those files in the same directory as the JavaScriptDotNet.dll, but you've probably already tried that.

from javascript.net.

Uncreal avatar Uncreal commented on July 29, 2024

Yes i tryed that. I basically copied all the settings from the working console application to new web application but i get a dependency error on JavaScript.Net.dll. I saw with the Assembly Binding Log Viewer that ASP.Net could not load icuuc.dll and icui18n.dll so i guess thats the problem.

from javascript.net.

oliverbock avatar oliverbock commented on July 29, 2024

Did you copy the 64-bit DLLs? Most servers are running 64 bit.

from javascript.net.

Uncreal avatar Uncreal commented on July 29, 2024

Yes i tryed everything. Is it possible to build Javascript.Net as one single dll with everything inside?
Thx for your help.

from javascript.net.

Uncreal avatar Uncreal commented on July 29, 2024

@spahnke Thank you very much! You helped a lot!

from javascript.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.