Search Wiki:

FastSharp

Write it, Execute it, Download it


FastSharp is a text editor which lets you compile and run C# code that would normally exist inside a method.


fsharpShot.PNG


The way FastSharp works is pretty simple. It takes whatever you enter and wraps it in a Main method which is then wrapped in a class which then has a list of import statements appended above it (configurable through the settings dialog). It then compiles the code using the Microsoft.CSharp.CSharpCodeProvider class and executes it. Because FastSharp wraps the code inside of a method block you can only write code that would normally compile inside of a method. (No classes or methods).

Areas for Future Improvement
  1. FastSharp can only do console output not input. I was unable to figure out how to make Console.ReadLine() work inside the program. This will be an important future feature if someone can figure it out.
  2. FastSharp compiles only C# code but it is not hard to make it work for Visual Basic also, which would also be a nice feature upgrade.
  3. FastSharp uses the out-of-the-box winforms RichTextBox control as the code editor. It would be nice to replace this with a code editor that color coded or even give intellisense :)

Click here to download FastSharp for .NET 3.5
Click here to download FastSharp for .NET 2.0

For more information please visit the corresponding blog post.
Last edited Feb 21 2008 at 8:41 AM  by mmanelaMSFT, version 11
Updating...
Page view tracker