为什么一直的ScriptEngine不再执行方法? [英] Why ScriptEngine has not Execute method anymore?
本文介绍了为什么一直的ScriptEngine不再执行方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前我已经开始更加认真与罗斯林工作。
我发现有关这篇文章使用的ScriptEngine
埃里克沃格尔的博客。
由于他的博客,应该有一个执行
方法在这个类:
Currently I've started to work with Roslyn more seriously.
I found this article about using ScriptEngine
on Eric Vogel's blog.
Due his blog, there should be an Execute
method in this class:
scriptEngine.Execute("1+1");
但似乎不存在了。
它在哪里去了?
But it seems it doesn't exist anymore. Where does it gone?
推荐答案
它被转移到会话对象。首先,你需要
It was moved to the session object. First you need to
var session = engine.CreateSession(SomeHostObject);
session.Execute("some code");
虽然应当指出罗斯林已被释放为Microsoft.CodeAnalysis现在和他们暂时删除脚本全部一起。从常见问题请参见
这篇关于为什么一直的ScriptEngine不再执行方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文