Change a blank project into a web project

© Microsoft
Project Selection in Microsoft Visual Studio ©

Whilst I was writing a WebApi OWIN tutorial, I started in an empty Solution with a blank Project and then wanted to change the blank project into a web project. There’s no way to do this via the GUI and I really wanted all the nice F5 tools. Rather than having to deploy to a website or IIS host each time, I’d rather start up a server at the press of a button. That way I can gain confidence in the startup of the app if I haven’t written tests yet.

There’s a few ways to do this:

  1. Modify the project metadata. You change the a blank solution to a web project. Visual Studio looks for the Guids that indicate the project is a web project and hooks up the tools.
  2. Create a new web project and drag all the files over to the new project. I much prefer this, as the project Guids and extra data (e.g., whether to use IIS, IIS Express and the hostname) is setup for you.

There’s a Stack Overflow around this which includes a list of the guids you can specify for the different types of Project: