I can't find where this setting is
#if !DEBUG
// some code
#endif
when I change the configuration dropdown from debug to release, I see no changes in my code, which suggests that my DEBUG symbol is not defined
EDIT
I do not see the setting in the Buid screen as Mark suggests:
If you go to the properties on the project (the website), go to the Build tab and make sure Define DEBUG constant is checked.
This setting can be changed for each build configuration.
If Mark's answer doesn't do it, try changing to
#ifndef DEBUG
/* ... */
#endif
or optionally
#if !defined(DEBUG)
/* ... */
#endif
and see if that helps?
In Web.config, change the compilation section to:
<compilation debug="false">
or
<compilation debug="true">
Worked for me, but it's annoying there is no option in the build screen.
Related
In my application I've more than one theme.
When I try to compile themes it compiles only one theme (the oldest I don't use anymore).
If I cancel that old theme it goes in error.
Where are stored names of themes to be compiled ?
Can I change them ?
Running the application in debug mode it compiles on the fly the correct one.
Tks
Tullio
Partially solved. I found in the plugin configuration the tag theme
and I corrected it. But I didn't find the way to compile more than one theme. Is it possible ? How ?
It should compile all the themes by default without needing to configure anything. Have you tried to remove the configuration?
I am playing around with the live templates for C# in ReSharper. I started doing this because of this question. When I get the the ReSharper templates explorer in Visual Studio, I see that there is a #if template and also an if template. My question is why?
I have read through the ReSharper help here, but that doesn't really shed much light on it (for me). I have also tried un-checking each template. It seems like the if template is the ReSharper if snippet, but I can't figure out what the #if template is for.
Is this the Visual Studio if snippet? If so, why don't I see both in the intellisense widow?
I know this is a really small issue, but I just want to know. Thanks.
#if is a preprocessor directive where as if is a C# selection statement
Example:
#if DEBUG
Console.WriteLine("Debug version");
#endif
vs
bool condition = true;
if (condition)
{
Console.WriteLine("The variable is set to true.");
}
Good afternoon,
I am having an issue trying to conditionally comment out some code sections and objects inside code that is generated by Windows Forms Designer.
If I simply comment out these objects, the designer will show no issues with the code and will display what I am working on
If I comment out with #ifdef and #endif in the code, the designer gives me
"C++ CodeDOM parser error: Line: 358, Column: 1 --- Unexpected token for a 'term' "
and will not display the UI I am working on. However the code will compile just fine without errors.
Is there a way to conditionally comment out sections of the designer code in the Form.h file?
Thanks,
-D
Do not edit designer-generated code. If your change works then it is not going to live long, wiped out when the designer re-generates the code. And the real problem, the designer code parser can only understand the kind of code it generates itself. It is not a full-blown compiler, it doesn't know beans what #ifdef might mean. Which is what the error is trying to tell you.
If you need conditional changes then you need to make them in form's constructor, after the InitializeComponent() call. You can remove or add controls and change their properties as needed.
So I've recently set-up a new project using Zurb's Foundation. I've got the default setting working from the gem setup (http://foundation.zurb.com/docs/sass.html).
The problem I am having is amending the buttons. By default my buttons appear square & I want a nice rounded corner style. So within the _settings.scss I have amended the following line:
$button-radius: 30px;
But nothing happens. So after reading the documentation I tried creating my own button class and including the button mixin like so:
.your-class-name {
#include button($padding, $bg, $radius, $full-width, $disabled, $is-input);
}
But when I do this I get an error saying that $padding doesn't exist! This has royally confused me as it's used throughout Foundation (or so I understand).
Can anyone suggest what may be going wrong here. I can provide any additional information if need be.
Lastly, I don't think the $global-radius option is being applied, because when I change the property but it's not causing an error so I'm a little stumped!
EDIT:
Here is the top of my core SASS file:
// Global Foundation Settings
#import "settings";
// Comment out this import if you don't want to use normalize
#import "normalize";
// Comment out this import if you are customizing you imports below
#import "foundation";
The default $border-radius did not work due to a bug in Foundation. I ran into it as well, but when I now went to double-check, it appears to have been fixed already in this commit. The problem was that $button-radius was defined twice in the settings file, one for buttons in general, and one for buttons in forms. The latter has now been renamed to $form-button-radius.
Is there any way to make visual studio dim or hide/show on demand logging lines of my code?
We use a lot of logging in our project and it's harder to read code like this.
I would like it to be like this, for example:
Unobtrusive Code extension worked for me for Visual Studio 2019. It dims the opacity of log lines (and comments, which I disabled - I enjoy reading my comments). He did a quick update for the nuget package, and it works great.
https://marketplace.visualstudio.com/items?itemName=niklaskallander.UnobtrusiveCode
I use this. Hoping one day they will add color customization and line selection regex options as well:
https://marketplace.visualstudio.com/items?itemName=ElmarXCV.GrayLogLines
There is no way to do this from the standard Visual Studio IDE. In order to do this you would need to define a custom extension which recognized lines like this, tagged them with a specific format and have that format be colored a lighter color in the IDE
a "hackier" way would be to wrap all logging in a preprocessor directive like
#if DEBUG
Log.Info(........)
#endif
Visual-Studio will "dim" the code inside.
and have some kind of config header where you
#define DEBUG 0
Not the prettiest but its nice if you don't want debug code compiled into your Release binary
why don't you put your section within #region tag.
E.G:
#region Put some region name here for your reference
Your Code / Comment / Whatever
#endregion