Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Call known method by name

$
0
0
Thanks for the quick response. I am using .Net 4.5.1

I tried your code sample in a console app, and an asp.net app, and it worked great.

Apparently my issue is that I am using a VisualWebGui application.
engine.Execute("function foo(x) { return x; }");
Console.WriteLine(engine.Script.foo(123));  // writes "123"
'System.Dynamic.DynamicObject' does not contain a definition for 'foo'

which mirrors the issues I am having. I can open Script in the debugger and see the foo method there.
:(

Any ideas?

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>