views:

223

answers:

3

I recently had a problem with the Issue Tracker starter kit that seemed to be resolved by using the "build" option. Previously, I would typically use the "play" button to debug my app, then just stage the files when everything was working, assuming that the last time I hit the "play" button, it had fully compiled the app.

Anyhow, I'm wondering if there's a difference between the "play" button and the "build" menu option? if so, what are the differences?

+3  A: 

The "build" button compiles your website while the "play" button builds and fires up a browser with the default page as an argument.

The "play" button is designed to execute a assembly that is designated in your solution as a starting point. Since an ASP.NET website has no true "entry point" (like static void Main() in a console application) the "play" button simulates a similar action by opening the browser to your projects "start page".

Andrew Hare
But hitting "play" compiles the application first, so it seems like the behavior is exactly the same, except that the play button *also* loads a browser. As far as the compile step of the process, they're doing exactly the same thing, right?
rwmnau
@rwmnau: You are 100% correct :)
Andrew Hare
+1  A: 

Play button (F5) executes your application in debug mode.

Build menu is only compiles and produces your assemblies.

And one another option, CTRL + F5, it runs your application but not in debug mode.

Canavar
+1 Good point about "debug mode" - I forgot about that!
Andrew Hare
yes, I just wanted to add :)
Canavar
A: 

The downside of "play" with a WebSite project is that you might miss a compiler error if the offending code is outside of the App_Code directory and you don't ever load the code that contains the error. I think doing a "build" does catch those kinds of errors.

Another gotcha to watch out for--if there are additional projects (such as class libraries) within the solution, make sure that the dependencies are set up correctly in the Configuration Manager so that those projects are built before "playing" the site. Otherwise you could make a change in the class library and then "play" the site but not see the change.

ranomore