0

I need my superusers to write some basic expressions like (getting today, or getting first day of last month, or just returning a default int value like 40), that I can later execute and get the result. It will be used for basic scripting that will provide an optional default value for a report parameter. It would be nice if it did not require any additional installation

So does c-sharp support any scripting languages that it can happily execute and evaluate?

thanks in advance,

It's an ASP.Net application and .Net Framework 4.5

5
  • What type of scripts? Try to look at IronPython, IronRuby or other Iron* scripting languages, which use DLR. Commented Nov 6, 2013 at 14:57
  • 1
    Have you looked at scriptcs? scriptcs.net Commented Nov 6, 2013 at 14:58
  • @IlyaIvanov Basic scripts that will provide an optional default value for a report parameter. It would be nice if it did not require any additional installation. Commented Nov 6, 2013 at 14:58
  • Maybe something like csscript? CSScript.Evaluator.Evaluate("DateTime.Today") Commented Nov 6, 2013 at 14:59
  • Are you looking for a particular feature? A Google search for "c# scripting" gives back a lot of results. I've used Razor templates successfully for reports in the past. Commented Nov 6, 2013 at 15:02

4 Answers 4

1

LUA is a scripting language that is able to be used from C#, take a look at LuaInterface

Sign up to request clarification or add additional context in comments.

Comments

1

You can use NLua (http://nlua.org/ https://www.nuget.org/packages/NLua/)

Super easy to integrate, and work on any platform.

Comments

0

I recently used IronPython to provide "scripting" to a program. You can embed the IronPython runtime in your program and let it execute scripts passed as a string. Look here for some examples.

You can also execute C# code compiled on the fly. See here.

Comments

0

Short answer, yes. There are a lot of different possible script engines for pretty much any possible scripting language.

Personally, i like to use C# for scripts too. Then make the program load the script file and compile it runtime.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.