4

Whenever I open a new (web) project in VS 2010 the default build configuration is set to "Active (Debug)". I read somewhere that if I upload my project like this to the server it would have a slight affect on performance (is this true?), so I have to manually go to properties and change it in the build tab to release. Is there any way to tell VS 2010 to open every new project in 'release' configuration?

BornToCode
  • 9,495
  • 9
  • 66
  • 83
  • Possible duplicate of [Add default build configuration to Visual Studio](http://stackoverflow.com/questions/17371404/add-default-build-configuration-to-visual-studio) – Palec Jan 03 '17 at 15:16

3 Answers3

5

I believe the build configurations are listed alphabetically, and the first one is always selected when starting a new project.

Since Debug and Release configurations are always added by default, you'll always get Debug selected unfortunately.

Fraser
  • 74,704
  • 20
  • 238
  • 215
  • This is the correct answer for me, not a big deal for me really, just change the active project to release and it will remember this selection the next time you open the solution. – EdChum Mar 07 '12 at 23:52
0

You would be better off performing a Publish operation when you want to deploy, as this will not only build in Release (or any configuration you wish), but also will only produce the files that are required by the application. You can publish to a local folder to then upload to a remote server.

devdigital
  • 34,151
  • 9
  • 98
  • 120
  • Thank you. The only drawback of this method is that when I want to modify the page by downloading it from the server (instead of looking for the last version on my hdd) and working on it locally I can't compile it because all the cs files are missing. Is there any way to automatically include them (and the csproj file) in the publish? – BornToCode Mar 01 '12 at 21:34
  • I'm not sure why you would want to modify it by downloading the deployed files from the server? Wouldn't you have a copy of the original source files on your computer ready to modify? – devdigital Mar 01 '12 at 23:44
-1

Yes, it is true that dll's built in debug mode will not perform as efficiently as dll's built in release mode. A debug mode build includes symbols to allow you to attach a debugger to the dll while it is running. The result of this is slightly larger, less performant set of libraries. However, unless you are doing some really intense mathmatical processing, you probably wouldn't notice the performance loss.

Release mode on the other hand will produce smaller, more efficient dll's but you won't be able to attach an external debugger once you have deployed your application.

I would recommend you leave your applications in debug mode while in development/test, and then before deploying to production, switch to release mode.

UPDATE: I now realize I didn't answer your original question but hopefully you find the advice useful.

Perry
  • 611
  • 6
  • 15
  • Thank you for that info. What do you mean by "attach an external debugger", what is it exactly and how do I add one? – BornToCode Mar 01 '12 at 21:38
  • @BornToCode - What I mean by that is attaching a debugger, in your case maybe Visual Studio to a process running your dev machine or another server. See this (http://msdn.microsoft.com/en-us/library/c6wf8e4z.aspx) – Perry Mar 01 '12 at 23:18
  • Also, what @devdigital is recommending is not a drawback. You want it that way. Only push your distributables to production. Keep all you source in source control so you don't have to keep track of which is the most current revision. SC does that for you. Try Subversion or Git. – Perry Mar 01 '12 at 23:23