In 6.12.4 Beta, #define before #load does not propagate

The topic kinda says it all, but basically, say I have a LINQPad file like this:

#define LINQPad
#load "HelloWorld\Program.cs"


With HelloWorld\Program.cs like this:

using System;

namespace HelloWorld
    static class Program
        internal static void Main() =>
#if LINQPad
            Console.WriteLine("Hello LINQPad!");
            Console.WriteLine("Hello World!");

The #define of LINQPad happening before #load does not propagate, as I get "Hello World!" in the results instead of "Hello LINQPad!". I suspect this wasn't originally expected, but is it possible for something like this to work, or is there a workaround/alternative for this? I mainly want to be able to use .Dump() in an external file but only if being loaded into LINQPad.

Sign In or Register to comment.