Visual Studio Tutorial 1
Visual Studio Tutorial 1
The below tutorial walks-through how to create, build and run your first web app using C# and the
Select File->New Project within the Visual Studio 2005 IDE. This will bring up the New Project
dialog. Click on the “Visual C#” node in the tree-view on the left hand side of the dialog box and
Choose where you want the project to be created on disk (note that there is no longer a
requirement for web projects to be created underneath the inetpub\wwwroot directory -- so you
can store the project anywhere on your filesystem). Then name it and hit ok.
Visual Studio will then create and open a new web project within the solution explorer. By default
it will have a single page (Default.aspx), an AssemblyInfo.cs file, as well as a web.config file. All
Double click on the Default.aspx page in the solution explorer to open and edit the page. You can
do this using either the HTML source editor or the design-view. Add a "Hello world" header to the
page, along with a calendar server control and a label control (we'll use these in a later tutorial):
Build and Run the Project
Hit F5 to build and run the project in debug mode. By default, ASP.NET Web Application projects
are configured to use the built-in VS web-server (aka Cassini) when run. The default project
templates will run on a random port as a root site (for example: http://localhost:12345/):
You can end the debug session by closing the browser window, or by choosing the Debug->Stop
When you compile/build ASP.NET Web Application projects, all code-behind code, embedded
resources, and standalone class files are compiled into a single assembly that is built in the \bin
sub-directory underneath the project root (note: you can optionally change the location if you
If you choose the "Show All Files" button in the solution explorer, you can see what the result of
ASP.NET Web Application Projects share the same configuration settings and behaviors as standard
VS 2005 class library projects. You access these configuration settings by right-clicking on the
project node within the Solution Explorer in VS 2005 and selecting the "Properties" context-menu
item. This will then bring up the project properties configuration editor. You can use this to
change the name of the generated assembly, the build compilation settings of the project, its
Developers use this tab to configure how a web project is run and debugged. By default, ASP.NET
Web Application Projects are configured to launch and run using the built-in VS Web Server (aka
This port number can be changed if this port is already in use, or if you want to specifically test
IIS instead, select the "Use IIS Web Server" option and enter the url of the application to launch,
you hit F5 in the project, Visual Studio will then launch a browser to that web application and
automatically attach a debugger to the web-server process to enable you to debug it.
Note that ASP.NET Web Application Projects can also create the IIS vroot and configure the
application for you. To do this click the "Create Virtual Directory" button.