Search code examples
c#visual-studiovisual-studio-2010

The program does not compile when I run it in VS2010


When I press F5 in Visual Studio 2010, my code does not compile anymore. Instead, it running the most recent compiled code. To compile the code, I have to right click on the program and choose Build and then run

How do I get my program to compile on each run?


Solution

  • It is a setting in Visual Studio. Opening the settings dialog, there should be a category "Projects and Solutions" (sorry, I use the German version - not quite sure what the English labels are). In there's another section "Build and Run". The second combo box from the top allows you to adjust what happens when running projects that have been modified.

    Another option is the solution properties. There are settings in there where you can configure which project within the solution should be compiled. To get there, right-click the solution, select "Properties", there select "configuration" (?). There's a check box for each project in a list that you need to check to have the project built.