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 6197975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:55:00+00:00 2026-05-24T03:55:00+00:00

I have several of these in my code which have been working fine so

  • 0

I have several of these in my code which have been working fine so far:

#If DEBUG Then    
   ... some code here       
#End If     

Now, i am noticing that, lately, the code inside the ” #If DEBUG Then … #End If”
gets execute also in “Release Mode”.

This is strange and did not happen before. What could have happened so that
the #If DEBUG are now being ignored (they are ignored both in debug in the IDE or the final executable) ?

I have applied Clean, Rebuild, etc.: no luck. Thank you for any hints and help.

-Pam

  • 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-05-24T03:55:00+00:00Added an answer on May 24, 2026 at 3:55 am

    Firstly, make sure you understand the difference between how you’re running the code and how you’re building it. Too many people equate “launching in a debugger” with “the debug version” and “launching not in a debugger” with “the release version”. They’re completely orthogonal – you can launch a release build in a debugger (typically with less information available) and you can launch a debug build not in a debugger. Apologies if you were already aware of this.

    Now, assuming you really have changed the project configuration you’re building to Release, you need to check the project properties for that specific configuration. I don’t know what it looks like in VB, but in C# in the project properties, in the build tab, there will be a list of defined symbols – that is what affects whether #if DEBUG code is built or not. Perhaps someone has copied over the project configuration from Debug into Release?

    EDIT: One way to check this at build time is:

    #if DEBUG
    #error This shouldn't happen
    #endif
    

    In a release build, that should build without error. In debug, it won’t.

    EDIT: Another option is that your overall solution configuration is now referring to the wrong project configuration types. I can’t remember the exact menu name, but if you look around Project for Configuration Manager, you should be able to bring up a grid mapping “Project” and “Solution Configuration” to the project configuration to build.

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

Sidebar

Related Questions

I have seen a couple of instances now where some legacy code I'm working
One of the products which I have been working started some 10 years back.
I have been working on a project which had been split over several servers
i have some Orders that can have several Items and these Items have an
I've been working on a C# project which uses a TabControl . I have
I have been using Netbeans for several months now and like it a lot.
I have been working on a C# WinForms application that registers several hot keys
I have seen several sites where these social share buttons looks perfectly horizontal aligned.
i have several classes with members called 'Id'. Originally i wanted to store these
We have several cron jobs that ftp proxy logs to a centralized server. These

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.