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

Suitable constructor for Jering.Javascript.NodeJS.HttpClientService Exception #180

Open
NiftyImages opened this issue Oct 3, 2023 · 2 comments

Comments

@NiftyImages
Copy link

First let me say Thank You.
I got your library to work on a console project to test the functionality and it worked as expected (even better).

I'm now creating an asp.net app .NET Framework 4.7 and I'm receiving the following error:

A suitable constructor for type 'Jering.Javascript.NodeJS.HttpClientService' could not be located. Ensure the type is concrete and all parameters of a public constructor are either registered as services or passed as arguments. Also ensure no extraneous arguments are provided.

If anyone could help or point me in the right direction I would greatly appreciate it.

@NiftyImages
Copy link
Author

For more context, I've tried both the StaticNodeJSService and DependencyInjection.

//
var services = new ServiceCollection();
services.AddNodeJS();
ServiceProvider serviceProvider = services.BuildServiceProvider();
INodeJSService nodeJSService = serviceProvider.GetRequiredService();
var t = await nodeJSService.InvokeFromStringAsync(javascript);
//

And:

//
var t = await StaticNodeJSService.InvokeFromStringAsync(javascript);
//

@JeremyTCD
Copy link
Member

Hi, what package version are you using?

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

No branches or pull requests

2 participants