Precompile Statements (#if) Not Dynamically Updating in VS 2017 RRS feed

  • Question

  • Hello,

    It appears precompile statements are no longer dynamically updating in VS2017 when changing the Build Configuration (without reopening the project).  For example, if you open a project in 'Debug' Build Configuration and compile the following code:

                bool bIsDebug;
    #if (DEBUG)
                bIsDebug = true;
                bIsDebug = false;

    bIsDebug will compile as 'true' as expected.  But if you change the Build Configuration to 'Release', it still compiles bIsDebug as 'true' unless you close and reopen the project.

    Note: I've only tested this on .NET Core Class Library using VS2017 C#.  Have not investigated other project types.  Thanks,


    Thursday, May 10, 2018 4:08 PM


All replies