views:

116

answers:

4

I need to run some validation tests on our c# client-server configuration. Is there a dynamic script language that my client application could run, that would have full access to all of its C# classes and asssemblies?

Something like beanshell for java: http://www.beanshell.org/intro.html

Thanks!

+8  A: 

I think your best option would be Windows Powershell.

CaptainTom
Powershell is awesome, but I wouldn't use it as an application scripting language. It's just too adapted to be a command-line shell in my opinion.
Gabe
+3  A: 

How about IronPython?

tzaman
Another good choice.
CaptainTom
There's also IronRuby and, if I recall correctly, IronLua.
Vitor Py
Looks good. What I would like to do is to run my application, and then run an IronPython script that will manipulate my loaded classes. Is this possible? Is there an interactive shell where I could fire off IronPython commands?
Jacko
A: 

I recommend trying out Mono's Evaluator class, which has methods for evaluating single statements or code blocks (which are returned as delegates).

Mark H
A: 

If your application is an ASP.NET application, you can effectively script it in C# using the App_Code folder. In the application's folder, create a folder called App_Code and drop a .cs file in there. Any changes to this file will be dynamically compiled by the ASP.NET compiler and result in a restart of the application. This code will have access to all of the assemblies in your app.

To get this code to execute, you can hook up to an application event or you can write a piece of code in your application to dynamically discover and call it, for example by implementing a known interface with an App_Code class and doing an assembly scan for it when your app starts.

jonsequitur