9

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.

nycdan
  • 2,819
  • 2
  • 21
  • 33
  • 2
    I saw this in VS2013 as well. Publish will compile and push from the Release build, but it doesn't reset it back afterwards. I never found a workaround, so it may unfortunately be "as designed". – Martin Noreke Aug 17 '15 at 03:28
  • Interesting. If true, that would seem to render the toolbar button rather useless. – nycdan Aug 17 '15 at 03:32
  • 1
    My understanding from watching the publish is that it changes the build to release, then calls the build method behind the scenes with a rebuild (doesn't matter if already built for me), followed by performing the push to the server. It forgets to cache and reset the build drop down which is a shame. – Martin Noreke Aug 17 '15 at 03:43
  • 2
    Yeah I'm seeing this too. VS2013 didn't do this. It's very annoying. – Tod Sep 28 '15 at 08:29
  • 1
    +1 Very annoying indeed. Keep forgetting to set it back :( FYI you can set the build configuration for the publish operation in the Publish Profile. Normally you need it to be Release, but under certain conditions you can work with Debug. – savehansson Dec 09 '15 at 08:09
  • @MartinNoreke I have found a workaround, see my answer. – Rudey May 26 '16 at 17:35
  • It appears this is fixed in Visual Studio 2017. – Rudey Mar 20 '17 at 16:50

1 Answers1

1

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.

Rudey
  • 4,717
  • 4
  • 42
  • 84