Skip to content

Method 'Evaluate' in type 'JSPool.JsEngineWithOwnThread' from assembly 'JSPool, Version=2.0.1.0, Culture=neutral, PublicKeyToken=2fc7775f73072640' does not have an implementation. #23

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

Closed
richayrich opened this issue May 5, 2017 · 12 comments

Comments

@richayrich
Copy link

Hi,

I'm trying to get React working, which when installed through NuGet pulled in JSPool automatically.
I'm seeing this exception when loading a .jsx file:

[TypeLoadException: Method 'Evaluate' in type 'JSPool.JsEngineWithOwnThread' from assembly 'JSPool, Version=2.0.1.0, Culture=neutral, PublicKeyToken=2fc7775f73072640' does not have an implementation.]
   JSPool.JsPool.<CreateEngineFactory>b__2_0() +0
   JSPool.JsPool`1.CreateEngine() +19
   JSPool.JsPool`1.PopulateEngines() +18
   JSPool.JsPool`1..ctor(JsPoolConfig`1 config) +191
   React.JavaScriptEngineFactory.CreatePool() +373
   React.JavaScriptEngineFactory..ctor(JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem) +119
   lambda_method(Closure , Object[] ) +128
   React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +682

Any ideas? I've tried downgrading to both 2.0.0 and 0.4.1, which result in slightly different errors.

Thanks,
Rich

@heinzmuller
Copy link

@richayrich Have you found any fix/workaround for this error? Got this error today myself

@JoachimL
Copy link

We're also struggling with this. Any workarounds?

@richayrich
Copy link
Author

@heinzmuller Nope, I haven't progressed past this error.

@Daniel15
Copy link
Owner

Daniel15 commented May 11, 2017 via email

@Daniel15
Copy link
Owner

I'm very confused by this error, because Evaluate does have an implementation:

return RunOnThread(engine => engine.Evaluate(expression));

@heinzmuller
Copy link

@Daniel15 Did you manage to replicate it?

@Daniel15
Copy link
Owner

Daniel15 commented May 12, 2017

I haven't been able to replicate this. I tested with .NET Framework 4.5.2:

And with .NET Core 1.1:

Could you please check the file versions of React.Core.dll, JSPool.dll and JavaScriptEngineSwitcher.Core.dll in your site's bin directory? You can view this by right-clicking the assemblies and selecting "Properties"

@Taritsyn
Copy link
Contributor

This error is caused by changes in the JavaScript Engine Switcher version 2.4.0:

In IJsEngine interface was added overloaded versions of the Evaluate, Evaluate<T> and Execute methods, which take the document name as second parameter.

You need to roll back the JavaScript Engine Switcher to version 2.3.X.

@Daniel15
Copy link
Owner

Thanks for the info @Taritsyn! Ideally backwards-incompatible changes to the public API (like adding new overloads) should be in a new major version (like 3.0.0) as per semver.

I'll bump the JavaScriptEngineSwitcher version in the next JSPool release.

@Taritsyn
Copy link
Contributor

@Daniel15 I recommend you inherit wrappers not from the IJsEngine interface, but from the JsEngineBase base class.

@Taritsyn
Copy link
Contributor

Ideally backwards-incompatible changes to the public API (like adding new overloads) should be in a new major version (like 3.0.0) as per semver.

Next time I will do so. This time I considered that adding new methods is not a serious API change.

@Daniel15
Copy link
Owner

Daniel15 commented Jul 1, 2017

Should be fixed in JSPool 3.0. I'll publish an updated version of ReactJS.NET that uses JSPool 3.0 shortly.

@Daniel15 Daniel15 closed this as completed Jul 1, 2017
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

5 participants