Thursday, April 10, 2008

Web Application Projects vs Web Site Projects

Maor David had a great post on Web Application Projects vs Web Site Projects. Details is here: http://maordavid.blogspot.com/2007/06/aspnet-20-web-site-vs-web-application.html

There is also a great MSDN article on this: http://msdn2.microsoft.com/en-us/library/aa730880(VS.80).aspx. Scroll down to the section "Comparing Web Site Projects and Web Application Projects".

In addition to the articles above, one thing I dislike the web site project is VS always put the solution file (.sln) is inside the My documents folder. I like to put the solution file in the same folder as the web site in. Here is the simple work around to do this:
  1. Create a blank solution file first (file -> new project -> other project types -> virtual studio solutions -> blank solution).
  2. Add the website in the solution (right click the blank solution -> Add new website).

Tuesday, April 01, 2008

How to expand a fixed VHD

There are times that I wish the virtual hard drive that I created could be bigger. Here is how to do it:

  1. download the VhdResizer from here: http://vmtoolkit.com/files/folders/converters/entry87.aspx
  2. select the old VHD as source and name your new VHD (make sure that your new VHD name is different from the source VHD name.), then hit resize buttom.
  3. after the VhdResizer finished running, you'll notice that the size of the new VHD is increased.

Wish it was this simple. Here is the steps you have to follow in order to expand the extra spaces you just allocated to the new VHD. (if you run the new VHD right now, you will notice that it's still have the same space. But if you go to Computer Management, you will see the extra space is unallocated).

Here are the steps to make the extra space available to your new VHD:
  1. attach the new VHD as data disk to your old VHD. (old VHD will be your C: and new VHD will be D:) (again, make sure the new VHD name is different from the old VHD name before you attach the new VHD to the old. Otherwise, you won't be able to extend the partition.).
  2. run the old VHD.
  3. open Command Prompt and type "diskpart".
  4. type "list disk". it will list all the disk avaiable on your VHD.
  5. type "select disk [disk index #].
  6. type "list partition".
  7. type "select partition [partition #].
  8. type "extend".

This should do it. Good luck.