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

  • Home
  • SEARCH
  • 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 7493627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:05:39+00:00 2026-05-29T17:05:39+00:00

My logging library has a simple DebugLogger that looks like this: public class DebugLogger

  • 0

My logging library has a simple DebugLogger that looks like this:

public class DebugLogger : Logger
{
    protected override void PerformLogging(string entry)
    {
        Debug.WriteLine(entry);
    }
}

The logging library has been built in RELEASE mode.

An application that references the logging library is being developed in DEBUG mode, naturally.

The problem is that when the application using the logging library calls DebugLogger.PerformLogging("some debug message") nothing shows up in the Visual Studio debug output.

I have verified things do work as expected when the logging assembly is built in DEBUG mode.

I was expecting that that the entry assembly being in DEBUG mode would take precedence, but it looks like this is not the case.

Is there anything that can be done?

edit

http://msdn.microsoft.com/en-us/library/6x31ezs1.aspx in the remarks section talks about the compiler ignoring Debug methods without DEBUG being defined.

  • 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-29T17:05:50+00:00Added an answer on May 29, 2026 at 5:05 pm

    How the Debug.WriteLine call is processed is determined when the project containing the call is compiled. In this case the C# compiler sees a call to Debug.WriteLine in a Release project (DEBUG not defined) and hence doesn’t emit the call into the resulting IL. At this point the PerformLogging method has no reference to Debug.WriteLine and hence no call from a build of any type will execute a Debug.WriteLine call.

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

Sidebar

Related Questions

A Java event logging (analytics) library has a method that takes an event name
What logging library or approach would you recommend for this case: We want to
I was looking at the Ruby logging library Logging.logger method and have a question
I created a simple Caching Data Access Layer that has caching using the Enterprise
I'm writing a class library as an abstraction to use for logging in any
Our low level logging library has to cope with all sorts of log messages
what I'd like to do (for logging purposes) is something like this: This code
This is a question that has been asked before, but unfortunately no solution seems
Java has a lot of frameworks / APIs that help you do logging in
I am using enterprise library logging block 5.0. My solution has over 20 projects,

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.