Questions tagged [csharpscript]

CSharpScript is a CLR based scripting system which uses the C# programming language.

CSharpScript or CS-Script is a CLR (Common Language Runtime) based scripting system (Script execution engine) which uses ECMA-compliant C# as a programming language. CSharpScript currently targets Microsoft implementation of CLR (.NET 2.0/3.0/3.5/4.0/4.5) with full support on Mono.

Hello.cs

using System;
using System.Windows.Forms;
class Script {
    static void Main() {
        MessageBox.Show("Hello World!");
    }
}

Hosting script engine

dynamic script = CSScript.Evaluator
                         .LoadMethod(@"void SayHello(string greeting) {
                                   Console.WriteLine(greeting);
                               }");
script.SayHello("Hello World!");

Benefits of C# Scripting System:

  • Simple deployment approach
  • Portability
  • Base language is a full featured C# and also supports VB.NET, C++/CLI and J#
  • Easy conversion of any script into application and vice versa
  • Script language is type safe
  • Extensibility
  • Script hosting
  • brings you Dynamic Code Generation

Useful links:

32 questions
0
votes
1 answer

DateTime in roslyn CSharpScript returns 'expecting ;'

Use of DateTime within the roslyn CSharpScript evaluator returns error code 'Expected ;' while strings work fine. Using Visual Studio 2019 with Microsoft.CodeAnalysis.Common and Microsoft.CodeAnalysis.CSharp.Scripting 3.3.1 Understanding that the…
Badchenn
  • 21
  • 4
0
votes
0 answers

CSharpScript - TypeLoadException

I am using the Microsoft.CodeAnalysis.CSharp.Scripting's CSharpScript (version 3.4.0-beta2-final) to execute custom calculations. Some calculations are not defined directly in the script, but delegated to a compiled static methods of class…
1 2
3