AngleSharp / AngleSharp.Js

:angel: Extends AngleSharp with a .NET-based JavaScript engine.
https://anglesharp.github.io
MIT License
103 stars 22 forks source link

Reflection Error when getting Jint engine reference #82

Closed greengiant83 closed 2 years ago

greengiant83 commented 2 years ago

Given the below test code, a ReflectionTypeLoadException is thrown when calling GetOrCreateJint

        var source = "<!DOCTYPE html><html lang='en'><body><script>console.log('Oi!');</script></body></html>";
        var config = Configuration.Default.WithJs();
        var context = BrowsingContext.New(config);
        var document = await context.OpenAsync(req => req.Content(source));
        var jsService = context.GetService<JsScriptingService>();
        var jsEngine = jsService.GetOrCreateJint(document); //<-- Error thrown here: ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.