Quick question with C #, I would like to know that in my project> Properties> Assembly there is a check "Define DEBUG constant" , so if I check this and then I do it,
[Conditional(DEBUG)] public static void Foo() { Console.WriteLine("Executed Foo"); }
See "DEBUG" for its DEBUG constant . So will it be good? Or do I need to add "DEBUG" to conditional compilation symbols in the project settings? Or #define ?
I am sure you need to do:
[Conditional("Debug")] or [Conditional("DEBUG")]
, :
const string DEBUG = "DEBUG";
[Conditional(DEBUG)]
#define DEBUG. . # MSDN.
#define DEBUG
:
[Conditional("DEBUG")] // <- Works the DEBUG define public static void Foo() { Console.WriteLine("Executed Foo"); }
Source: https://habr.com/ru/post/1727763/More articles:MQ Job Connection: Newbie - ibm-mqWhat does this statement mean? - operatorssimultaneous processing java.nio.channels.Selector - javaSharePoint and MVC - asp.net-mvcHow to draw text in iPhone OpenGL ES - iphoneA question with a newbie that I have to ask, a beginner of network programming for games? - boostCommunication between processes - c ++Simple SQL vs. Dialects - genericsспособ реализации МПК - c++What is the advantage of ASP.NET precompilation? - asp.netAll Articles