64

How do I switch between debug and release in Visual C# 2010 Express?

I have looked in the project properties, but it seems to be missing. What am I missing?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Thiago Padilha
  • 4,590
  • 5
  • 44
  • 69

6 Answers6

147
  1. Enable the ToolsSettingsExpert Settings menu option

  2. Go to ToolsOptions
    In the dialog box, check Show All Settings option in the bottom left.

  3. In the above dialog, now choose Projects and SolutionsGeneral.
    Check the option Show advanced build configurations.

  4. Click OK.

You should be able to see the Release/Debug options in the toolbar now.

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
gotopie
  • 2,594
  • 1
  • 20
  • 23
  • I've been looking for that too. The weird thing is that all this time I didn't know how to change the configuration but apparently the program was building both every time. Then I installed Windows 7 and when reopened my project I couldn't get to build the release version. Until the active configuration miraculously changed to Release for mysterious reasons. Then I couldn't put it back on debug until I found this thread. Does anyone know how come my VC# was building both configurations and how to make it do that again? It was quite handy. – Juan Sep 03 '10 at 22:48
  • Damn, this does not work for me in VC#E 2010. The toolbar does not change. The only way I can get a Release build is to build the solution in "Basic Settings" (or run the project without debugging in Basic Settings mode). In Expert Mode, it produces Debug builds only no matter what. – Qwertie Apr 10 '11 at 19:27
  • Oh crap, I switched back to Basic Settings and now even Basic Settings won't ever produce Release builds, even if I uncheck Show advanced build configurations. Oh well, at least I can still produce Release builds with SharpDevelop. But they don't offer that nice configuration switcher in their toolbar. – Qwertie Apr 10 '11 at 19:42
  • 3
    Wow. This is the most complete answer to this question that I've found. Kind of annoying when all I wanted to do was just set the output directory for a debug build. – Wes P May 15 '11 at 16:32
  • 1
    We actually don't need to worry about this 98% of the time. Running a project with F5 always creates a debug build, while building with F6 always makes a release build. – Artfunkel Jun 10 '11 at 15:32
  • @JuanLuisSoldi 3 years later: I had the experience that when I press F6 to build. It created Release. When I pressed F5 to start debugging it build the Debug and started it right away. I liked this setting until now it's broken and only one can be created. – Bitterblue Jun 25 '13 at 09:42
31

Heh, that one baffled me too when I first installed Visual C# Express 2010. It turns out Microsoft has added a "Basic settings" mode to the Express editions that is selected by default.

You can change to "Expert settings" mode in the Tools menu, after that, the Debug/Release combo will be back.

Expert Settings in Visual Studio's Tools menu

Most IDE settings (window docking locations, font settings, etc.) seem to be kept in separate profiles between basic and expert mode, so you'll have to arrange your tool windows again and so on.

Cygon
  • 9,444
  • 8
  • 42
  • 50
  • 4
    A completely unrelated question @Cygon: I'm curious how that screenshot was taken. It looks very clean and tidy! Is there a special utility for that sort of screen capturing? – stakx - no longer contributing May 30 '10 at 13:58
  • 7
    Not that I know of. I'm just really pedantic with such things - in this case I used Paint Shop Pro's 'Screen Capture' and copied & pasted clean parts of the drop shadow over where it was distorted by stuff in the background :P – Cygon Jun 01 '10 at 16:01
  • Thank you! Funny thing is that this alone still wasn't enough. I had to combine your answer with the one from from Siege, but alas, it works. Finally... – walther Nov 10 '12 at 01:01
10

I'm sure there's some obscure way that I don't remember... what I do know is that if you click "Build" it will build the Release version, but if you click "Start Debugging" it will build the Debug version. So if you just want to be able to get the output from both versions, that should sort it for you.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • Makes sense? But what if I want to to debug using the release configuring (Azure database instead of local and other stuff without manually changing the normal debug webconfig?) – Piotr Kula May 24 '13 at 09:46
  • @ppumkin: Does the accepted answer help you? If not, I suggest you might want to ask a separate, more detailed question. – Jon Skeet May 24 '13 at 14:27
  • No - I searched around for a while something strange is happening. Changing the build configurations to anything always uses `debug` - If i cant find the solution I will ask a new question. Thanks for reply +1 – Piotr Kula May 24 '13 at 15:16
3

You can follow these steps for visual studio 2010 professional edition.

  1. Go to Tools -> Customize .
  2. Select Commands Tab.
  3. Select ToolBar and then Build from combobox.
  4. Click on Add Command Button.
  5. Select Build from Categories and then select Solution Configurations from Commands.
Sagar Gupta
  • 131
  • 2
  • 8
1

This is really strange. I've installed Windows 7 Pro x64, then I installed Visual C# 2010 Express and I couldn't find it at all. No matter how I built, it always produced Debug version. I could press F6 or press Build button and it still produced Debug version and I don't have any select box with Debug/Release to choose.

Finally I found it. I can change it by clicking my Soulution in Solution Explorer window and then in Properties window under Active Config.

prostynick
  • 6,129
  • 4
  • 37
  • 61
0

The last answer by prostynick was the final clue. I am using visual studio 2010 express. First you need to have the advanced setting checked Tools ---> Settings

Next is solution explorer double left click or single right click "My Project" to open the project.

You get a large screen with application, compile, debug ... menu on the side

Select Compile

Look at "Build Output path: It is probably pointing at bin\Debug folder.

Changing this will change where output from a build goes