Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
3 Feb 2012SoftwareMonkeys
While I think alternative 3 could be quite useful I often have access to the assembly name and not the actual file name.For example the assembly name might be:Company.ProductWhereas the file name might be:Company.Product.dllThere are times when I'll fully qualify a class such...
24 Feb 2012Andreas Gieriet
I prefer the [Conditional("DEBUG")] attribute over #if DEBUG.This is especially advised for your logging example.E.g.[System.Diagnostics.Conditional("DEBUG")]private void Validate() { /* check instance integrity */ }or[System.Diagnostics.Conditional("DEBUG")]public static...
29 Jan 2012Pablo Aliskevicius
You can make it a bit shorter: public virtual bool IsDebug { get { #if (DEBUG) return true; #else return false; #endif } }Thanks for sharing,
4 Feb 2012SoftwareMonkeys 4 alternatives
Sometimes, it's useful to know whether you're running in debug or release mode so you can do extra work during debugging and skip it during release. This class makes that as simple as possible.
I was born in the south of China, started to write GWBASIC code since 1993 when I was 13 years old, with professional .net(c#) and vb, founder of www.xnlab.com
Now I am living in Sydney, Australia.