text: Believe it or not, I was never sure about this until this morning when another dev and I were discussing it. So, I searched the web and found the answer:
  Build means compile and link only the source files that have changed since the last build, while Rebuild means compile and link all source files regardless of whether they changed or not. Build is the normal thing to do and is faster. Sometimes the versions of project target components can get out of sync and rebuild is necessary to make the build successful. In practice, you never need to Clean.
  Build or Rebuild Solution builds or rebuilds all projects in the your solution, while Build or Rebuild <project name> builds or rebuilds the StartUp project. To set the StartUp project, right click on the desired project name in the Solution Explorer tab and select Set as StartUp project. The project name now appears in bold.
  Compile just compiles the source file currently being edited. Useful to quickly check for errors when the rest of your source files are in an incomplete state that would prevent a successful build of the entire project. Ctrl-F7 is the shortcut key for Compile. (I just used this today with DotNetNuke - apparently the devs left out a codebehind class file on the EditAddress ASCX control for the WebStore. I simply excluded the control and it all built just fine. I'll worry about the Address thingy later [it was in C# BTW]).
  All source files that have changed are saved when you request a build/rebuild, so you don't have to save them first.
  When you run your executable (F5 or Ctrl-F5), Visual Studio saves all your changed source files and builds anything that changed, so you don't need to explicitly do those steps every time. This allows for quick "trial and error" debugging.
  Incidentally, if you like those little Visual Studio keyboard shortcuts, you can download posters of the C# and the VB.Net ones, respectively:
  C#:
  http://www.microsoft.com/downloads/details.aspx?FamilyID=c15d210d-a926-46a8-a586-31f8a2e576fe&DisplayLang=en
  VB.NET:
  http://www.microsoft.com/downloads/details.aspx?FamilyID=6bb41456-9378-4746-b502-b4c5f7182203&DisplayLang=en
  .NET FRAMEWORK VISUAL STUDIO
  Get link
  Facebook
  Twitter
  Pinterest
  Email
  Other Apps
  Comments
  Anonymous 12:23 PM
  i love these little shortcuts, i didnt realise there was one for compiling current page.
  mind you, it was only a few months ago i doscovered the joys of shift-delete in VS :D
  ReplyDelete
  Replies
  Reply
  Anonymous 7:56 AM
  Hehe - funny thing; I've got so much respect and get so much motivation and learned so much from reading your posts, and then: Didn't he know this - haha ;-))
  A fine christmas to all of you!
  ReplyDelete
  Replies
  Reply
  peterbromberg 12:07 PM
  Yup! There is no shame in not knowing something that you probably should know. There is shame in pretending that you know and acting like a moron about it.
  ReplyDelete
  Replies
  Reply
  Anonymous 5:52 PM
  Glad I found this article. I just installed new VS8, and when I select Build, it always rebuilds all of my projects, even if nothing has changed. Anyone have any idea what to look at?? Same sln/projects do not do this running in .NET 2003.
  klstevens1s@yahoo.com
  ReplyDelete
  Replies
  Reply
  peterbromberg 6:13 PM
  If you have projects in your solution that are pretty much "baked" and don't need to be rebuilt, set the Build action off in the Build configuration dialog for the solutio. You can set your solution to build only the projects in it that you want rebuilt.
  ReplyDelete
  Replies
  Reply
  Anonymous 9:39 AM
  It can also be done at the VS level:
  Tools -> Options -> Project and Solutions -> Build and Run -> select 'Only build startup projects and dependancies on run'
  Cheers
  IL
  ReplyDelete
  Replies
  Reply
  Unknown 7:35 PM
  Love it. Especially then bit about "Compile just compiles the source file currently being edited. ... Ctrl-F7 is the shortcut key for Compile."
  ReplyDelete
  Replies
  Reply
  Add comment
  Load more...
  Post a Comment
  Popular posts from this blog
  ASP.NET: Loss of Session / Cookies with Frames
  August 11, 2007
  Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining. -- Jef Raskin Recently we had a forum question on eggheadcafe.com where the user indicated they were losing Session because of the use of FRAMESET or an IFRAME. If you implement a FRAMESET where frames point to other Web sites on the networks of your partners or inside your network, but you use different top-level domain names, you may notice in Internet Explorer 6 that any cookies you try to set in those frames are lost. This is most frequently experienced as a loss of session state in an Active Server Pages (ASP) or ASP.NET Web application. You try to access a variable in the Session object that you expect to exist, and it is null. You can also see this problem in a FRAMEs context if your Web pages alternate between the use of Domain Name System (DNS) names and the use of Internet Protocol (IP) addresses. The fix is very si
  Read more
  March 02, 2019
  Read more
  Losing ASP.NET Sessions - Why Application Pools recycle
  October 10, 2007
  I've seen a more or less constant stream of questions on the asp.net newsgroup and the asp.net site forum messageboard, all of which revolve around the problem of "Why am I losing Sessions?". (BTW that is "losing" with one o, not "loosing"! Your pants might be loose , but if your Session goes away you can bet that you are losing it!). Heres a summary of what I've learned about this; comments and additions are always welcome: If your ASP.NET application crashes, has an unhandled exception, hangs or otherwise becomes brain-dead, it will cause the application pool to recycle. Sometimes your application pool recycles for no obvious reason. This is usually a configuration issue or it may be caused by your app performing file system operations in the application directory. Many times developers incorrectly set up SqlConnections so that they aren't properly closed and returned to the connection pool, and this can also cause your AppPool to recycle un
  Read more
  Powered by Blogger
  Theme images by Michael Elkan
  peterbromberg
  Peter is active on the C# and other MS newsgroups, has samples at gotdotnet.com (now codegallery.com) that have been downloaded over 56,000 times, and writes articles for eggheadcafe.com, for which he is a co-founder, and MSDNAA sites. He has also been a technical reviewer on books from Prentice Hall, Manning and other publishers. Peter was born and raised in New York City, and after a stint as a jazz musician playing contrabass with the Robert Hunt Trio, migrated to sunny Florida, where he was hired as a rookie Financial Consultant at Merrill Lynch in Orlando, specializing in Corporate Services. It was at Merrill that Peter realized computers and technology were his forte. He spent his last few years at Merrill developing real – time computerized trading and and stock charting program using advanced technical analysis indicators, some of which are his own inventions. In 1997, he moved on to architect and serve as lead developer on a number of innovative web-based and middleware solutions for the healthcare and financial services industry.