Click here to Skip to main content
12,892,469 members (49,531 online)
Click here to Skip to main content
Alternatives (2)
Add your own
alternative version

Tagged as


14 bookmarked
Posted 1 Sep 2011

Preventing stubbed methods from being released

, 1 Sep 2011 CPOL
A handy way to stub methods in development, but preventing them from being shipped in release mode.


Members may post updates or alternatives to this current article in order to show different approaches or add new features.

14 Oct 2011
Julien Villers
Nice tip! I'm also a proponent of using your friend the preprocessor to stop you from making big mistakes, along with your best friend, the compiler.You can combine both using this alternative code:private bool ValidateUserDetails(string userName, string password){ //TODO: Default value...
15 Oct 2011
Sander Rossel
Very nice tips indeed!A somewhat different approach to this might be to use the Debugger.IsAttached[^] static property.Though this works somewhat different.if (System.Diagnostics.Debugger.IsAttached){ // This code executes when starting from VS either in release or debug...


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Program Manager
United Kingdom United Kingdom
No Biography provided

| | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 1 Sep 2011
Article Copyright 2011 by Reiss
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid