I know this is a really old suggestion, but it's still the top google result for "linqpad output color". As such, there's a better way to do what Itsey suggests: The Util.WithStyle() function.
It can be used for console output (without losing whitespace):
public static void WriteColor(string s, ConsoleColor col)
Console.WriteLine(Util.WithStyle(s, "color:" + col.ToString()));
or as part of dumping:
public static T DumpColor<T>(this T obj, ConsoleColor color)
Util.WithStyle(obj, "color:" + color.ToString()).Dump();
Lprun only handles some of the usecases which this suggestion would enable. It doesn't allow (as Franklin Ross suggested) creating a *distributable* exe file.
https://linqpad.uservoice.com/forums/18302-linqpad-feature-suggestions/suggestions/1520279-ability-to-save-a-compiled-linqpad-script-to-an-ex was suggested to be a duplicate of this, but if lprun is considered to be "sufficient" to close this, then that feature will still be unaddressed.
You can almost accomplish this with snippets, if you have auto-complete (I don't know if you can use snippets without it). You can use them to import a set of references and using statements into the current query, but I don't know if it does database connections and it doesn't do code.
I need some feedback on this feature. First:
(a) Would you expect it to apply only to untitled queries? Or:
(b) Would you also expect it to apply to saved queries that were modified?
(The reason I ask is that option (a) is simple to implement, whereas option (b) creates numerous complications.)