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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:16:21+00:00 2026-05-27T02:16:21+00:00

In Visual Studio 2010, if you go to a project’s properties and go to

  • 0

In Visual Studio 2010, if you go to a project’s properties and go to the Build Tab, there is a checkbox for “Define TRACE Constant.” Which is the equivalent of doing a #define TRACE.

All of the methods of System.Diagnostics.Trace have a [Conditional("TRACE")] around them.

My question is why would you ever turn this off? I mean, if you don’t have any trace listeners defined, then it isn’t as if you’re going to fill up a log or something. It just feels weird to me. If you are going through the effort to put in calls to Trace, why would you want to not control it through the App/Web.config, but instead control it via a compiler switch, which rules out the possibility of turning it back on without a recompile.

Am I missing something? Surely, it can’t be THAT bad for performance, right?

  • 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-27T02:16:21+00:00Added an answer on May 27, 2026 at 2:16 am

    Presumably this checkbox is equivalent to the /define:TRACE compiler option. You might want to turn this option off for a release build either because you don’t want end users to see the trace output for some reason (e.g. security), or to improve performance. Of course, the performance increase will depend on how much work is being done when it’s on, but the Conditional attribute will cause the compiler to completely remove the function call (including any string formatting, etc.) from the generated IL, so it could make a significant difference.

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

Sidebar

Related Questions

I've got a visual studio 2010 project which publishes an assembly called myAssembly.ddl .
I have a Visual Studio 2010 C# project which creates an .exe and this
Visual Studio 2010 (Project Properties dialog) I've installed Visual Studio 2010 Ultimate and it
I have a visual studio-2010 project which contains lots of source files and header
I want to create a Visual Studio 2010 Project Template, which is essentially a
I have a Visual Studio 2010 Database project, from which I want to generate
Directly related to visual studio 2010 database project, is there a visual way? I
In my Visual Studio 2010 project I have files with .mm file extension, that
I've got a Visual Studio 2010 C++ project. Previously everything was working fine but
When I add a service reference to my Visual Studio 2010 C# project, a

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.