Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8738639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:46:19+00:00 2026-06-13T10:46:19+00:00

In C++ I have this: http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx . So I can write code that will

  • 0

In C++ I have this: http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx .

So I can write code that will run only when I’m debugging, or only for specific platforms (PowerPC, MIPS, Power Macintosh etc. it’s not supported anymore but it’s a very good example).
You could also switch like that between 32bit and 64bit systems (of course that’s only useful when you’re releasing 2 different builds, each with its own processor architecture. in C# it’s a rare need but nevertheless, it is there).

So my question is if something like that exists in C#.
I realize there are no macros, but there are however symbols (even with the same #define keyword. so it kind of make sense — for me at least — that it should exist.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:46:20+00:00Added an answer on June 13, 2026 at 10:46 am

    In .NET there are Pre-processing directives. To include some block of code only when debugging, you could do:

    #define Debug      // Debugging on
    
    class PurchaseTransaction
    {
       void Commit() {
          #if Debug
             CheckConsistency();
          #else
             /* Do something else
          #endif
       }
    }
    

    If you go to Project settings in Visual Studio, check the Build tab. There you can define Debug and Trace constants for selected configuration (checked by default for Debug build). You can also define additional conditional compilation symbols.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code, that i found on this website http://msdn.microsoft.com/en-us/library/efx1fwb6.aspx <asp:DataList runat=server ID=Datalist1
I have used code like this: http://msdn.microsoft.com/en-us/library/dw70f090.aspx to access database before when working in
I have a sql statement that uses Difference => http://msdn.microsoft.com/en-us/library/ms188753.aspx I do this in
I found this: http://msdn.microsoft.com/en-us/library/vslangproj80.reference3%28VS.80%29.aspx what I have in mind is that many of the
I just read this link http://msdn.microsoft.com/en-us/library/ms186243.aspx Here is the code to create table and
This link http://msdn.microsoft.com/en-us/library/aa772153(VS.85).aspx says: You can register up to five notification requests on a
According to this http://msdn.microsoft.com/en-us/library/cc849094(v=vs.85).aspx#OptInHighDPI you can make your web browser control use IE8-style zooming,
I have gone through this article http://msdn.microsoft.com/en-us/library/system.clscompliantattribute.aspx and would like to understand its real
This: http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keypress.aspx ...indicates that I should have access to e.KeyCode in the KeyPress event,
Im very new in C++ I have found this post http://msdn.microsoft.com/en-us/magazine/cc163486.aspx and trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.