Always include codes outside of Main() into the selection in Program mode
When the code fragment is selected and then F5 is pressed, LINQPad runs only selected code. I think this feature is nice.
When I choose "C# Program" mode, of course I write some utility codes outside the Main() method.
However, when I select the fragment of code in the Main() and press F5, the build fails, since the definitions outside the Main() wasn't included as "compile target codes".
I think that the codes outside Main() method (in C# / VB Program mode) should be always included in compile targets to enable user-defined classes and methods,
even if the code fragment is selected in the editor.
![](https://assets.uvcdn.com/pkg/admin/icons/user_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
Maxwell Bloch commented
Maybe this shouldn't be a C# Program. Use C# Statements in conjunction with Plugins.