#if (DEBUG) VS System.Diagnostics.Debugger.IsAttached

前端 未结 6 857
没有蜡笔的小新
没有蜡笔的小新 2020-12-24 11:52

What is different between using #if (DEBUG) and System.Diagnostics.Debugger.IsAttached in visual studio? Are there cases of the DEBUG

6条回答
  •  滥情空心
    2020-12-24 12:21

            private void ConfigureOAuthTokenConsumption(IAppBuilder app)
            {
    #if DEBUG
                AuthenticateViaAppOwnIdentity(app);
    #else
    AuthenticateViaAzureAD(app);
    #endif    
            }
    

    With this code, just try to change the build from debug to release and vice-versa. The running/excluded code will show changed in VS automatically as black and grayed out respectively

提交回复
热议问题