1

I am developing an application which requires a dynamic scripting system. I am using CS-Script to host the script execution. I would like to use C#7 features in the scripts (i.e. local methods) but cannot as the CodeDom evaluator engine does not support C#7 out of the box. I would have to switch to the Roslyn engine for C#7 support. My application requires fast execution of scripts and Roslyn simply does not offer this (a simple script takes 100ms+ to execute with Roslyn compared to < 20ms with the CodeDom engine).

Is it possible to enable C#7 language support using the CodeDom engine in CS-Script and, if so, how?

rodit
  • 1,746
  • 2
  • 19
  • 33
  • Did you read this issue: https://github.com/oleg-shilo/cs-script/issues/74? – Evk Nov 15 '17 at 20:17
  • @Evk thanks for your reply. I am able to get the C#7 features working using the Roslyn evaluator engine (`CSScript.EvaluatorConfig.Engine = EvaluatorEngine.Roslyn`) but I am not happy with the performance. When running the scripts with `CSScript.EvaluatorConfig.Engine = EvaluatorEngine.CodeDom`, I get much better performance. Is there any way I can have this option (`CSScript.EvaluatorConfig.Engine = EvaluatorEngine.CodeDom`) and C# language features as well? – rodit Nov 15 '17 at 20:32
  • That issue describes how to use c# 7 without Roslyn evaluator, not? Of course compiler will always be Roslyn, there is no way around that. – Evk Nov 15 '17 at 20:35
  • @Evk ok thanks - I must have misread/misunderstood the issue. – rodit Nov 15 '17 at 20:36

0 Answers0