Lance's Whiteboard

Random scribbling about C#, Javascript, Web Development, Architecture, and anything else that pops into my mind.

News


Creative Commons License
Lance's Whiteboard Blog by Lance Hunt is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Based on a work at weblogs.asp.net




Sponsored Ad
Sponsored Ad

Blogs I Read

Request for Whibey Team

I occasionally add code to my projects for testing purposes only. In most cases, I just bracket such code with preprocessor directives such as #if DEBUG .... #endif

However, in some cases, this code references another assembly, and this is where the problem begins. If the only purpose of the assembly is for this code, it's really annoying, since you have to constantly remove the reference to avoid having to deploy this depenency.

One simple feature I would love to see added to VS.NET 2004 is to add a property to Project Grid for References to allow you to apply a symbol - such as DEBUG, or perhaps a custom one like UNIT_TEST - to allow conditional compilation with or without referencing the assembly. This could be driven by the Conditional Compilation Constants defined for the project within Visual Studio.NET.

Later, I'll try to post some mocked-up screenshots of what I am talking about...

Posted: Jan 05 2004, 05:12 PM by CodeSniper | with 2 comment(s)
Filed under:

Comments

Jamie Cansdale said:

You should find that if you #if DEBUG out all of your unit tests, when you do a RELEASE build there won't be a reference to your testing framework assembly (eg nunit.framework.dll).
# January 5, 2004 7:58 PM

TrackBack said:

# March 19, 2004 3:11 AM