#if DEBUG vs. Conditional(“DEBUG”)

It really depends on what you’re going for: #if DEBUG: The code in here won’t even reach the IL on release. [Conditional(“DEBUG”)]: This code will reach the IL, however calls to the method will be omitted unless DEBUG is set when the caller is compiled. Personally I use both depending on the situation: Conditional(“DEBUG”) Example: … Read more

C# if/then directives for debug vs release

DEBUG/_DEBUG should be defined in VS already. Remove the #define DEBUG in your code. Set preprocessors in the build configuration for that specific build. The reason it prints “Mode=Debug” is because of your #define and then skips the elif. The right way to check is: #if DEBUG Console.WriteLine(“Mode=Debug”); #else Console.WriteLine(“Mode=Release”); #endif Don’t check for RELEASE.

What is private bytes, virtual bytes, working set?

The short answer to this question is that none of these values are a reliable indicator of how much memory an executable is actually using, and none of them are really appropriate for debugging a memory leak. Private Bytes refer to the amount of memory that the process executable has asked for – not necessarily … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)