Exclude class from release build

Posted on 2007-10-03
Last Modified: 2008-02-26
hi there,

I have a unit test class. How do i ensure that the class only appears in my Debug build and not in my release build?

This is for the whole class, not just methods in that class.

Question by:Valimai
    LVL 22

    Accepted Solution

    You can do it this way:
    #if DEBUG
    public class foo

    LVL 1

    Author Comment


    Thanks, I should have tried that. Reading through the junk results of google, it appeared I had to make custom attributes.

    Too much searching and not enought trialling. Cheers, 500 for u.
    LVL 22

    Expert Comment

    You gave me an easy one. Thanks, and good luck.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now