Self compiling scripts for .NET languages: C#, VB.NET and JScript.NET
Ok, these ones are pretty cool. It took me a few more hours than I thought, but it was worth it.
The C# and JScript.net wrappers are perfectly identical, the VB.NET one required a little more playing to get right. – and it’s just the smuggling lines that are different, the script itself is the same.
I’ve coded a simple hello world example into each of the languages.
The ‘trimmed’ versions allow you to simply add the five lines at the top, and the last line to your source file and have it run anywhere .NET 2.0 is installed.
Oh, and even better: if you drop the .JS on the end, the script loads in Visual Studio just fine as a class—you can do all of your testing with the script header in place and then just rename it when you want to redistribute it.