Always publish website with release code? - visual-studio

Is it possible to change some setting so that Visual Studio always use the "release" configuration when publishing?
I use debug mode when i develop to clear some caches and stuff like that and i also have different web.configs for release and debug. Sometimes when i publish i forget to change the configuration to release and i end up with a broken website ;)
I understand i can do this with MS Build or something but publish working fine except for this. Any tips?

In Solution Explorer, select the project.
On the View menu, click Property Pages.
Click the Build or Debug tab, in a Visual C# or a Visual F# project, the Compile or Debug tab, in a Visual Basic project, or Configuration Properties, in a Visual C++ project.
In the Configuration drop-down list, click Debug or Release."
Steps provided by:
http://msdn.microsoft.com/en-us/library/wx0123s5.aspx

As of at least VS 2017, the web publish settings now include a setting for which configuration to publish, which defaults to Release, so you can publish the release build even when VS is still in Debug configuration.
I just wish that they had also done this for regular Click-Once applications as well...

Related

Build specific configuration

Is there any Visual Studio extension available, that allows you to right-click a solution/project in the solution explorer and build as a specific configuration?
I find Visual Studio extremely slow at changing configuration, which is why I usually rely on running MSBuild directly.
A context menu below the Build action with all the configurations available would be quite nice.
Any suggestions?
In the main menu, select Build->Batch Build... and select the configuration/platform combination(s) you want to build. It's not ideal when you have a lot of projects though.

Why there is no Debug configuration in Visual Studio 2010?

I downloaded the source code of a Visual Studio 2010 project, and since I have to analyze it for my University I'd like to be able to debug with breakpoints
Problem is, my Configuration popup only shows Release as option, there is no Debug option and so my breakpoints are always ignored
This is the first time I try to use VS, I always used Eclipse as IDE and I really don't know how to solve this - I tried to search the web but it didn't help
So, how can I run a VS project in debug with my breakpoints?
Thanks in advance
If it can help, here's the project - http://scene.sourceforge.net/download.html
EDIT
If it can helps, when I try to debug in existing configuration a pop up warns me that ( loosely translated from italian, not the exact sentence ) "Debug informations related to project not found. Binary not compilated with debug informations".
A VS project can hold many configurations, not just the default Win32 Debug and Release. It's also possible to delete existing configurations which is probably your case.
You can add the Debug configuration by right clicking on the solution within VS and select Build Configuration. Select new and ask to copy from Release.
Manually change the build options to a debug build which time consuming BTW. You'll need to go over each and every option.

Visual Studio stopped rebuilding dependent projects

Suddenly, Visual Studio 2010 has stopped behaving as it used to:
I have a solution containing several projects: a Class Library project, an Application project and a Test project.
The Application project is set as default startup project.
Now if I change anything in the Class Library and press F5, Visual Studio does not rebuild the Class Library anymore, so that it runs outdated code.
Same behaviour with the Test project.
What am I doing wrong? I am pretty sure this type of behaviour is new, but I do not know what I have changed.
In the solution explorer, right click on the solution name and go to "Configuration Manager.."
You will see the active solution configuration. Select which project to build or not by turning the checkbox on or off. Hope that solves your problem.

Start Debugging F5 doesn't automatically build

I used to have the environment optimized for c# but recently I have been doing a mostly c++ work. So after a format, I selected c++ instead. Once in a while I still do some c#/xna stuff so I installed xna as well. Problem is that visual studio does not behave anything like I remember it behaving when I had the environment optimized for c#. The run button no longer compiles the solution. Hell, compiling the solution does nearly nothing... I need to recompile for my changes to take effect. What the hell?
I have tried Tools > Import and Export Settings > Reset all settings, reinstalling xna and visual studio and still the F5 does not compile.
edit: Turns out that the projects were set to not compile under the configuration options. I never set this though. I found a forum with several people who had the same issue: http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/8657c07a-da08-4a9f-9558-0c9d93c94ce2/
If you have a number of configurations, it's possible that the currently selected configuration doesn't have the project (you want to auto-build) in it.
For example.
The default configurations are DEBUG and RELEASE and all the projects (in the solution) are ticked against this.
But if you've manually un-ticked a project against one of these configurations OR you've manually added a new project and then un-ticked that project in the configuration .. Visual Studio won't compile those un-ticked projects.
So double check your configuration. (Right Click on the Solution name => Configuration Manager).
I hope this will fix your problem: Start debugging F5 does not build automatically, Visual Studio.
First check what should happen when you run a project. To do this, open Tools > Options, Projects and Solutions, Build and Run, and check that you have selected for the On Run, when projects are out of date option:
Make sure you have selected Always Build...
To change you settings:
Tools -> Import and Export Settings
Choose: Import selected environment settings
Save you settings if you want
You are then presented with a set of default settings to choose from (General, C++, C#)

Visual Studio won't make debug DLL

Visual Studio won't make a debug DLL when I select Debug for the configuration.
Instead it makes a release version. The output window show it's making a release version, even with a Debug configuration selected. The release DLL it produces has the current date.
When I save the project in the Debug configuration and reload it, it has magically switched to the Release configuration.
The project has been behaving for months, and this problem just started happening today.
What's going on, and how can I make it produce a debug DLL?
Your project build configuration is probably set to Release for the Debug solution configuration. Open the Configuration Manager (right click on solution, click "Configuration Manager..."). Select "Debug" as the active solution configuration and make sure all projects in the list have "Debug" selected as their configuration.
right click on the solution in the solution explorer, select properties, then click on Configuration, make sure the debug configuration has each sub project set to debug.

Resources