Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 changes config from debug to release when i publish

I have a project set to Debug config for normal coding. When I publish using the 'Publish Web' button, the config automatically changes to Release after the publish is completed. If I open 'Edit Publish Profile' and publish from the dialog box, this does not happen.

Anyone know if this is a bug or something I can address through some type of config setting?

Thanks.

like image 274
nycdan Avatar asked Aug 17 '15 03:08

nycdan


People also ask

How do I change from debug to Release in Visual Studio?

On the toolbar, choose either Debug or Release from the Solution Configurations list. From the Build menu, select Configuration Manager, then select Debug or Release.

How do I set active configuration in Visual Studio?

Project configurations To modify the properties of a project, open the shortcut menu for the project in Solution Explorer, and then choose Properties. At the top of the Build tab of the project designer, choose an active configuration to edit its build settings.

Why Release is faster than debug?

Lots of your code could be completely removed or rewritten in Release mode. The resulting executable will most likely not match up with your written code. Because of this release mode will run faster than debug mode due to the optimizations.


1 Answers

Martin Noreke's comment is correct:

Publish will compile and push from the Release build, but it doesn't reset it back afterwards.

Vice versa, if you publish using a profile that has a Debug configuration while having Release selected, Visual Studio switches to Debug.

This only happens when you use the Web Click Once Publish toolbar though.

If you publish using the Publish Web dialog, Visual Studio doesn't switch the configuration. You can open this dialog by clicking the button next to the publish button on the toolbar, or by right-clicking your project and clicking "Publish...".

Edit: It appears this is fixed in Visual Studio 2017.

like image 164
Rudey Avatar answered Oct 03 '22 19:10

Rudey