1 person following this project (follow)

Project Description
What if your website had a full fledged scripting language embedded inside it? IronConsole is based on the DLR(C#/IronPython) and allows you to script your app at runtime via a browser console. Useful for quick debugging,querying/modifying session/context/singletons at runtime.

Screenshots
http://ironconsole.codeplex.com/documentation

Since IronConsole runs under the same appdomain as your website, IronConsole has access to the current HttpContext and hence the ASP.NET session as well. And any other global objects in your appdomain.

Current supported DLR (0.91) language is IronPython, IronRuby. Type in #python or #ruby to switch between the languages.

Install
Adding IronConsole to an existing ASP.NET site is just a simple matter of dropping a few files under the website root.
You don't have to write any code or modify your application.

Just download the release, IronConsoleInstaller.zip and do the following:
  1. Copy the files in bin to the bin of your website.
  2. Copy the ScriptConsole folder to the root of your website.
  3. Access the ajax version at http://localhost/yourwebapp/ScriptConsole/IronConsole.aspx! This is the recommended entry point.
  4. Access http://localhost/yourwebapp/ScriptConsole/SplitConsole.aspx or http://localhost/yourwebapp/ScriptConsole/console.aspx for a non-ajax version.

Note: You really don't have to know IronPython/IronRuby to use this app, something like Session["Name"] = "Aroj" or ShowCookies() is the kind of simple commands that you will mostly be using. And yes, if you are a python/ruby ninja, then rock on!

Objects available at the console:
  • session :- the session object.
  • context :- HttpContext.Current
  • identity :- HttpContext.User.Identity
  • System :- the system namespace has been auto-imported. So you could just go print System.DateTime.Now without having to do import System in python
  • or p System::DateTime.Now without having to do a 'require' on System in ruby.

Python functions available at the console:
  • ShowCookies()
  • ShowSession()
  • pdump() :- Reflects over an object and prints the values of all properties one level deep.
Besides the above, since you have full access to the entire .NET framework, you could simply add a reference to any dll and import it into the console, like below,
clr.AddReference('<dll name>')
import <namespace>

Ruby functions available at the console:
  • None as of now, work in progress...but you can ofcourse write your own in the script window.

Script Extensions
You can extend the console by adding your own scripts under the ScriptConsole\Scripts\Default or the ScriptConsole\Scripts\UserDefined folders.
Note that as of now only python scripts are being loaded, need a way to configure ruby scripts as well.

TODO:
  • Dynamically load .NET dll extensions as well.
  • Ajaxify the execute script/command and avoid the post backs... done! (release 0.5)
  • Make things more secure.

Short Python Tips


Thanks To:
  • http://blogs.msdn.com/jmstall/archive/2005/09/01/Howtoembedironpython.aspx :- The inspiration behind the idea.
  • http://blogs.msdn.com/hugunin/ :- Father of IronPython :-)

Note: IronConsole is not intended for production use or to allow end users to script the application. Atleast not yet! The current use case is more for development time debugging/playing around/tinkering/learning etc..Specially useful in environments without Visual Studio installed like your QA environment for e.g.

Last edited Nov 2 2009 at 10:25 AM by Aroj, version 31